From d9f9c5295df7a40012d18081ac382c4633d7470b Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 20 Jul 2023 22:09:32 +0000 Subject: [PATCH 1/2] feat: added network and uid fields in Endpoint message feat: added uid field to Namespace message feat: added uid field to Service message feat: enable Location methods docs: updated docs for ResolveServiceRequest message docs: updated docs for ListServicesRequest and ListEndpointsRequest message PiperOrigin-RevId: 549683092 Source-Link: https://github.com/googleapis/googleapis/commit/c661ee0ec7aa53e87fa14033c8e9e3689b830021 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e3c7b0298a532a7101d2ae8ec1dc0a0e2cfbb2c5 Copy-Tag: eyJwIjoiU2VydmljZURpcmVjdG9yeS8uT3dsQm90LnlhbWwiLCJoIjoiZTNjN2IwMjk4YTUzMmE3MTAxZDJhZThlYzFkYzBhMGUyY2ZiYjJjNSJ9 --- .../Cloud/Servicedirectory/V1/Endpoint.php | 42 + .../Servicedirectory/V1/LookupService.php | 41 + .../Cloud/Servicedirectory/V1/PBNamespace.php | 37 + .../V1/RegistrationService.php | 135 ++ .../Cloud/Servicedirectory/V1/Service.php | 39 + .../V1/CreateEndpointRequest.php | 194 ++ .../V1/CreateNamespaceRequest.php | 199 ++ .../V1/CreateServiceRequest.php | 194 ++ .../V1/DeleteEndpointRequest.php | 82 + .../V1/DeleteNamespaceRequest.php | 82 + .../V1/DeleteServiceRequest.php | 82 + .../Cloud/ServiceDirectory/V1/Endpoint.php | 359 ++++ .../V1/GetEndpointRequest.php | 84 + .../V1/GetNamespaceRequest.php | 82 + .../ServiceDirectory/V1/GetServiceRequest.php | 84 + .../V1/ListEndpointsRequest.php | 359 ++++ .../V1/ListEndpointsResponse.php | 106 ++ .../V1/ListNamespacesRequest.php | 339 ++++ .../V1/ListNamespacesResponse.php | 106 ++ .../V1/ListServicesRequest.php | 347 ++++ .../V1/ListServicesResponse.php | 106 ++ .../Cloud/ServiceDirectory/V1/PBNamespace.php | 153 ++ .../V1/ResolveServiceRequest.php | 265 +++ .../V1/ResolveServiceResponse.php | 71 + .../Cloud/ServiceDirectory/V1/Service.php | 256 +++ .../V1/UpdateEndpointRequest.php | 137 ++ .../V1/UpdateNamespaceRequest.php | 137 ++ .../V1/UpdateServiceRequest.php | 137 ++ .../V1/LookupServiceClient/get_location.php | 53 + .../V1/LookupServiceClient/list_locations.php | 58 + .../LookupServiceClient/resolve_service.php | 73 + .../create_endpoint.php | 82 + .../create_namespace.php | 78 + .../create_service.php | 81 + .../delete_endpoint.php | 70 + .../delete_namespace.php | 65 + .../delete_service.php | 70 + .../get_endpoint.php | 72 + .../get_iam_policy.php | 66 + .../get_location.php | 53 + .../get_namespace.php | 66 + .../RegistrationServiceClient/get_service.php | 71 + .../list_endpoints.php | 77 + .../list_locations.php | 58 + .../list_namespaces.php | 72 + .../list_services.php | 76 + .../set_iam_policy.php | 69 + .../test_iam_permissions.php | 74 + .../update_endpoint.php | 58 + .../update_namespace.php | 58 + .../update_service.php | 58 + .../BaseClient/LookupServiceBaseClient.php | 296 +++ .../RegistrationServiceBaseClient.php | 830 +++++++++ .../v1/src/V1/Client/LookupServiceClient.php | 40 + .../V1/Client/RegistrationServiceClient.php | 40 + .../src/V1/Gapic/LookupServiceGapicClient.php | 463 +++++ .../Gapic/RegistrationServiceGapicClient.php | 1561 ++++++++++++++++ .../v1/src/V1/LookupServiceClient.php | 34 + .../v1/src/V1/RegistrationServiceClient.php | 34 + .../v1/src/V1/gapic_metadata.json | 142 ++ .../lookup_service_client_config.json | 50 + .../lookup_service_descriptor_config.php | 57 + .../lookup_service_rest_client_config.php | 45 + .../registration_service_client_config.json | 135 ++ ...registration_service_descriptor_config.php | 292 +++ ...egistration_service_rest_client_config.php | 282 +++ .../V1/Client/LookupServiceClientTest.php | 279 +++ .../Client/RegistrationServiceClientTest.php | 1532 ++++++++++++++++ .../tests/Unit/V1/LookupServiceClientTest.php | 241 +++ .../Unit/V1/RegistrationServiceClientTest.php | 1369 ++++++++++++++ .../Servicedirectory/V1Beta1/Endpoint.php | 45 + .../V1Beta1/LookupService.php | 41 + .../Servicedirectory/V1Beta1/PBNamespace.php | 40 + .../V1Beta1/RegistrationService.php | 135 ++ .../Servicedirectory/V1Beta1/Service.php | 42 + .../V1beta1/CreateEndpointRequest.php | 170 ++ .../V1beta1/CreateNamespaceRequest.php | 174 ++ .../V1beta1/CreateServiceRequest.php | 170 ++ .../V1beta1/DeleteEndpointRequest.php | 68 + .../V1beta1/DeleteNamespaceRequest.php | 68 + .../V1beta1/DeleteServiceRequest.php | 68 + .../ServiceDirectory/V1beta1/Endpoint.php | 447 +++++ .../V1beta1/GetEndpointRequest.php | 70 + .../V1beta1/GetNamespaceRequest.php | 68 + .../V1beta1/GetServiceRequest.php | 70 + .../V1beta1/ListEndpointsRequest.php | 352 ++++ .../V1beta1/ListEndpointsResponse.php | 106 ++ .../V1beta1/ListNamespacesRequest.php | 332 ++++ .../V1beta1/ListNamespacesResponse.php | 106 ++ .../V1beta1/ListServicesRequest.php | 344 ++++ .../V1beta1/ListServicesResponse.php | 106 ++ .../ServiceDirectory/V1beta1/PBNamespace.php | 241 +++ .../V1beta1/ResolveServiceRequest.php | 265 +++ .../V1beta1/ResolveServiceResponse.php | 71 + .../ServiceDirectory/V1beta1/Service.php | 352 ++++ .../V1beta1/UpdateEndpointRequest.php | 122 ++ .../V1beta1/UpdateNamespaceRequest.php | 122 ++ .../V1beta1/UpdateServiceRequest.php | 122 ++ .../LookupServiceClient/get_location.php | 53 + .../LookupServiceClient/list_locations.php | 58 + .../LookupServiceClient/resolve_service.php | 73 + .../create_endpoint.php | 82 + .../create_namespace.php | 78 + .../create_service.php | 81 + .../delete_endpoint.php | 70 + .../delete_namespace.php | 65 + .../delete_service.php | 70 + .../get_endpoint.php | 72 + .../get_iam_policy.php | 66 + .../get_location.php | 53 + .../get_namespace.php | 66 + .../RegistrationServiceClient/get_service.php | 71 + .../list_endpoints.php | 77 + .../list_locations.php | 58 + .../list_namespaces.php | 72 + .../list_services.php | 76 + .../set_iam_policy.php | 69 + .../test_iam_permissions.php | 75 + .../update_endpoint.php | 58 + .../update_namespace.php | 58 + .../update_service.php | 58 + .../Gapic/LookupServiceGapicClient.php | 475 +++++ .../Gapic/RegistrationServiceGapicClient.php | 1623 +++++++++++++++++ .../src/V1beta1/LookupServiceClient.php | 36 + .../src/V1beta1/RegistrationServiceClient.php | 36 + .../v1beta1/src/V1beta1/gapic_metadata.json | 142 ++ .../lookup_service_client_config.json | 50 + .../lookup_service_descriptor_config.php | 22 + .../lookup_service_rest_client_config.php | 45 + .../registration_service_client_config.json | 135 ++ ...registration_service_descriptor_config.php | 52 + ...egistration_service_rest_client_config.php | 297 +++ .../Unit/V1beta1/LookupServiceClientTest.php | 241 +++ .../V1beta1/RegistrationServiceClientTest.php | 1369 ++++++++++++++ 134 files changed, 23934 insertions(+) create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/Endpoint.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/LookupService.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/PBNamespace.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/RegistrationService.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/Service.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateEndpointRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateNamespaceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateServiceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteEndpointRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteNamespaceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteServiceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/Endpoint.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetEndpointRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetNamespaceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetServiceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListEndpointsRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListEndpointsResponse.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListNamespacesRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListNamespacesResponse.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListServicesRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListServicesResponse.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/PBNamespace.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ResolveServiceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ResolveServiceResponse.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/Service.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateEndpointRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateNamespaceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateServiceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/get_location.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/list_locations.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/resolve_service.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_endpoint.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_namespace.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_service.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_endpoint.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_namespace.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_service.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_endpoint.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_iam_policy.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_location.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_namespace.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_service.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_endpoints.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_locations.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_namespaces.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_services.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/set_iam_policy.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/test_iam_permissions.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_endpoint.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_namespace.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_service.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/Client/BaseClient/LookupServiceBaseClient.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/Client/BaseClient/RegistrationServiceBaseClient.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/Client/LookupServiceClient.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/Client/RegistrationServiceClient.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/Gapic/LookupServiceGapicClient.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/Gapic/RegistrationServiceGapicClient.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/LookupServiceClient.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/RegistrationServiceClient.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/resources/lookup_service_client_config.json create mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/resources/lookup_service_descriptor_config.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/resources/lookup_service_rest_client_config.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_client_config.json create mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_descriptor_config.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_rest_client_config.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/Client/LookupServiceClientTest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/Client/RegistrationServiceClientTest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/LookupServiceClientTest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/RegistrationServiceClientTest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/Endpoint.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/LookupService.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/PBNamespace.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/RegistrationService.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/Service.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateEndpointRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateNamespaceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateServiceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteEndpointRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteNamespaceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteServiceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/Endpoint.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetEndpointRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetNamespaceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetServiceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListEndpointsRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListEndpointsResponse.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListNamespacesRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListNamespacesResponse.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListServicesRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListServicesResponse.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/PBNamespace.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ResolveServiceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ResolveServiceResponse.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/Service.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateEndpointRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateNamespaceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateServiceRequest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/get_location.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/list_locations.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/resolve_service.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_endpoint.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_namespace.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_service.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_endpoint.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_namespace.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_service.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_endpoint.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_iam_policy.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_location.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_namespace.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_service.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_endpoints.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_locations.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_namespaces.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_services.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/set_iam_policy.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/test_iam_permissions.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_endpoint.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_namespace.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_service.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/Gapic/LookupServiceGapicClient.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/Gapic/RegistrationServiceGapicClient.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/LookupServiceClient.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/RegistrationServiceClient.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/lookup_service_client_config.json create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/lookup_service_descriptor_config.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/lookup_service_rest_client_config.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_client_config.json create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_descriptor_config.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_rest_client_config.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/tests/Unit/V1beta1/LookupServiceClientTest.php create mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/tests/Unit/V1beta1/RegistrationServiceClientTest.php diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/Endpoint.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/Endpoint.php new file mode 100644 index 00000000000..0ca6bf3933c --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/Endpoint.php @@ -0,0 +1,42 @@ +internalAddGeneratedFile( + ' + +/google/cloud/servicedirectory/v1/endpoint.proto google.cloud.servicedirectory.v1google/api/resource.proto" +Endpoint +name ( BA +address ( BA +port (BAU + annotations ( 2;.google.cloud.servicedirectory.v1.Endpoint.AnnotationsEntryBA@ +network ( B/AA) +\'servicedirectory.googleapis.com/Network +uid ( BA2 +AnnotationsEntry +key (  +value ( :8:A +(servicedirectory.googleapis.com/Endpointfprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}B +$com.google.cloud.servicedirectory.v1B EndpointProtoPZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb Google.Cloud.ServiceDirectory.V1 Google\\Cloud\\ServiceDirectory\\V1#Google::Cloud::ServiceDirectory::V1Aa +\'servicedirectory.googleapis.com/Network6projects/{project}/locations/global/networks/{network}bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/LookupService.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/LookupService.php new file mode 100644 index 00000000000..96f5c1fda89 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/LookupService.php @@ -0,0 +1,41 @@ +internalAddGeneratedFile( + ' + +5google/cloud/servicedirectory/v1/lookup_service.proto google.cloud.servicedirectory.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto.google/cloud/servicedirectory/v1/service.proto" +ResolveServiceRequest= +name ( B/AA) +\'servicedirectory.googleapis.com/Service + max_endpoints (BA +endpoint_filter ( BA"T +ResolveServiceResponse: +service ( 2).google.cloud.servicedirectory.v1.Service2 + LookupService +ResolveService7.google.cloud.servicedirectory.v1.ResolveServiceRequest8.google.cloud.servicedirectory.v1.ResolveServiceResponse"LF"A/v1/{name=projects/*/locations/*/namespaces/*/services/*}:resolve:*SAservicedirectory.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB +$com.google.cloud.servicedirectory.v1BLookupServiceProtoPZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb Google.Cloud.ServiceDirectory.V1 Google\\Cloud\\ServiceDirectory\\V1#Google::Cloud::ServiceDirectory::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/PBNamespace.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/PBNamespace.php new file mode 100644 index 00000000000..90e97166da9 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/PBNamespace.php @@ -0,0 +1,37 @@ +internalAddGeneratedFile( + ' + +0google/cloud/servicedirectory/v1/namespace.proto google.cloud.servicedirectory.v1google/api/resource.proto" + Namespace +name ( BAL +labels ( 27.google.cloud.servicedirectory.v1.Namespace.LabelsEntryBA +uid ( BA- + LabelsEntry +key (  +value ( :8:nAk +)servicedirectory.googleapis.com/Namespace>projects/{project}/locations/{location}/namespaces/{namespace}B +$com.google.cloud.servicedirectory.v1BNamespaceProtoPZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb Google.Cloud.ServiceDirectory.V1 Google\\Cloud\\ServiceDirectory\\V1#Google::Cloud::ServiceDirectory::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/RegistrationService.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/RegistrationService.php new file mode 100644 index 00000000000..312acf036ea --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/RegistrationService.php @@ -0,0 +1,135 @@ +internalAddGeneratedFile( + ' +7 +;google/cloud/servicedirectory/v1/registration_service.proto google.cloud.servicedirectory.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto/google/cloud/servicedirectory/v1/endpoint.proto0google/cloud/servicedirectory/v1/namespace.proto.google/cloud/servicedirectory/v1/service.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto" +CreateNamespaceRequest9 +parent ( B)AA# +!locations.googleapis.com/Location + namespace_id ( BAC + namespace ( 2+.google.cloud.servicedirectory.v1.NamespaceBA" +ListNamespacesRequest9 +parent ( B)AA# +!locations.googleapis.com/Location + page_size (BA + +page_token ( BA +filter ( BA +order_by ( BA"r +ListNamespacesResponse? + +namespaces ( 2+.google.cloud.servicedirectory.v1.Namespace +next_page_token ( "V +GetNamespaceRequest? +name ( B1AA+ +)servicedirectory.googleapis.com/Namespace" +UpdateNamespaceRequestC + namespace ( 2+.google.cloud.servicedirectory.v1.NamespaceBA4 + update_mask ( 2.google.protobuf.FieldMaskBA"Y +DeleteNamespaceRequest? +name ( B1AA+ +)servicedirectory.googleapis.com/Namespace" +CreateServiceRequestA +parent ( B1AA+ +)servicedirectory.googleapis.com/Namespace + +service_id ( BA? +service ( 2).google.cloud.servicedirectory.v1.ServiceBA" +ListServicesRequestA +parent ( B1AA+ +)servicedirectory.googleapis.com/Namespace + page_size (BA + +page_token ( BA +filter ( BA +order_by ( BA"l +ListServicesResponse; +services ( 2).google.cloud.servicedirectory.v1.Service +next_page_token ( "R +GetServiceRequest= +name ( B/AA) +\'servicedirectory.googleapis.com/Service" +UpdateServiceRequest? +service ( 2).google.cloud.servicedirectory.v1.ServiceBA4 + update_mask ( 2.google.protobuf.FieldMaskBA"U +DeleteServiceRequest= +name ( B/AA) +\'servicedirectory.googleapis.com/Service" +CreateEndpointRequest? +parent ( B/AA) +\'servicedirectory.googleapis.com/Service + endpoint_id ( BAA +endpoint ( 2*.google.cloud.servicedirectory.v1.EndpointBA" +ListEndpointsRequest? +parent ( B/AA) +\'servicedirectory.googleapis.com/Service + page_size (BA + +page_token ( BA +filter ( BA +order_by ( BA"o +ListEndpointsResponse= + endpoints ( 2*.google.cloud.servicedirectory.v1.Endpoint +next_page_token ( "T +GetEndpointRequest> +name ( B0AA* +(servicedirectory.googleapis.com/Endpoint" +UpdateEndpointRequestA +endpoint ( 2*.google.cloud.servicedirectory.v1.EndpointBA4 + update_mask ( 2.google.protobuf.FieldMaskBA"W +DeleteEndpointRequest> +name ( B0AA* +(servicedirectory.googleapis.com/Endpoint2 +RegistrationService +CreateNamespace8.google.cloud.servicedirectory.v1.CreateNamespaceRequest+.google.cloud.servicedirectory.v1.Namespace"a;"./v1/{parent=projects/*/locations/*}/namespaces: namespaceAparent,namespace,namespace_id +ListNamespaces7.google.cloud.servicedirectory.v1.ListNamespacesRequest8.google.cloud.servicedirectory.v1.ListNamespacesResponse"?0./v1/{parent=projects/*/locations/*}/namespacesAparent + GetNamespace5.google.cloud.servicedirectory.v1.GetNamespaceRequest+.google.cloud.servicedirectory.v1.Namespace"=0./v1/{name=projects/*/locations/*/namespaces/*}Aname +UpdateNamespace8.google.cloud.servicedirectory.v1.UpdateNamespaceRequest+.google.cloud.servicedirectory.v1.Namespace"cE28/v1/{namespace.name=projects/*/locations/*/namespaces/*}: namespaceAnamespace,update_mask +DeleteNamespace8.google.cloud.servicedirectory.v1.DeleteNamespaceRequest.google.protobuf.Empty"=0*./v1/{name=projects/*/locations/*/namespaces/*}Aname + CreateService6.google.cloud.servicedirectory.v1.CreateServiceRequest).google.cloud.servicedirectory.v1.Service"fD"9/v1/{parent=projects/*/locations/*/namespaces/*}/services:serviceAparent,service,service_id + ListServices5.google.cloud.servicedirectory.v1.ListServicesRequest6.google.cloud.servicedirectory.v1.ListServicesResponse"J;9/v1/{parent=projects/*/locations/*/namespaces/*}/servicesAparent + +GetService3.google.cloud.servicedirectory.v1.GetServiceRequest).google.cloud.servicedirectory.v1.Service"H;9/v1/{name=projects/*/locations/*/namespaces/*/services/*}Aname + UpdateService6.google.cloud.servicedirectory.v1.UpdateServiceRequest).google.cloud.servicedirectory.v1.Service"hL2A/v1/{service.name=projects/*/locations/*/namespaces/*/services/*}:serviceAservice,update_mask + DeleteService6.google.cloud.servicedirectory.v1.DeleteServiceRequest.google.protobuf.Empty"H;*9/v1/{name=projects/*/locations/*/namespaces/*/services/*}Aname +CreateEndpoint7.google.cloud.servicedirectory.v1.CreateEndpointRequest*.google.cloud.servicedirectory.v1.Endpoint"uQ"E/v1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints:endpointAparent,endpoint,endpoint_id + ListEndpoints6.google.cloud.servicedirectory.v1.ListEndpointsRequest7.google.cloud.servicedirectory.v1.ListEndpointsResponse"VGE/v1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpointsAparent + GetEndpoint4.google.cloud.servicedirectory.v1.GetEndpointRequest*.google.cloud.servicedirectory.v1.Endpoint"TGE/v1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}Aname +UpdateEndpoint7.google.cloud.servicedirectory.v1.UpdateEndpointRequest*.google.cloud.servicedirectory.v1.Endpoint"wZ2N/v1/{endpoint.name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}:endpointAendpoint,update_mask +DeleteEndpoint7.google.cloud.servicedirectory.v1.DeleteEndpointRequest.google.protobuf.Empty"TG*E/v1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}Aname + GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy""?/v1/{resource=projects/*/locations/*/namespaces/*}:getIamPolicy:*ZO"J/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:getIamPolicy:* + SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy""?/v1/{resource=projects/*/locations/*/namespaces/*}:setIamPolicy:*ZO"J/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:setIamPolicy:* +TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse""E/v1/{resource=projects/*/locations/*/namespaces/*}:testIamPermissions:*ZU"P/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions:*SAservicedirectory.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB +$com.google.cloud.servicedirectory.v1BRegistrationServiceProtoPZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb Google.Cloud.ServiceDirectory.V1 Google\\Cloud\\ServiceDirectory\\V1#Google::Cloud::ServiceDirectory::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/Service.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/Service.php new file mode 100644 index 00000000000..f2fbabaaef6 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/Service.php @@ -0,0 +1,39 @@ +internalAddGeneratedFile( + ' + +.google/cloud/servicedirectory/v1/service.proto google.cloud.servicedirectory.v1google/api/resource.proto/google/cloud/servicedirectory/v1/endpoint.proto" +Service +name ( BAT + annotations ( 2:.google.cloud.servicedirectory.v1.Service.AnnotationsEntryBAB + endpoints ( 2*.google.cloud.servicedirectory.v1.EndpointBA +uid ( BA2 +AnnotationsEntry +key (  +value ( :8:A| +\'servicedirectory.googleapis.com/ServiceQprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}B +$com.google.cloud.servicedirectory.v1B ServiceProtoPZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb Google.Cloud.ServiceDirectory.V1 Google\\Cloud\\ServiceDirectory\\V1#Google::Cloud::ServiceDirectory::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateEndpointRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateEndpointRequest.php new file mode 100644 index 00000000000..ca922f44227 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateEndpointRequest.php @@ -0,0 +1,194 @@ +google.cloud.servicedirectory.v1.CreateEndpointRequest + */ +class CreateEndpointRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the service that this endpoint provides. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $endpoint_id = ''; + /** + * Required. A endpoint with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $endpoint = null; + + /** + * @param string $parent Required. The resource name of the service that this endpoint provides. Please see + * {@see RegistrationServiceClient::serviceName()} for help formatting this field. + * @param \Google\Cloud\ServiceDirectory\V1\Endpoint $endpoint Required. A endpoint with initial fields set. + * @param string $endpointId Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * @return \Google\Cloud\ServiceDirectory\V1\CreateEndpointRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\ServiceDirectory\V1\Endpoint $endpoint, string $endpointId): self + { + return (new self()) + ->setParent($parent) + ->setEndpoint($endpoint) + ->setEndpointId($endpointId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the service that this endpoint provides. + * @type string $endpoint_id + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * @type \Google\Cloud\ServiceDirectory\V1\Endpoint $endpoint + * Required. A endpoint with initial fields set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the service that this endpoint provides. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the service that this endpoint provides. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEndpointId() + { + return $this->endpoint_id; + } + + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEndpointId($var) + { + GPBUtil::checkString($var, True); + $this->endpoint_id = $var; + + return $this; + } + + /** + * Required. A endpoint with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ServiceDirectory\V1\Endpoint|null + */ + public function getEndpoint() + { + return $this->endpoint; + } + + public function hasEndpoint() + { + return isset($this->endpoint); + } + + public function clearEndpoint() + { + unset($this->endpoint); + } + + /** + * Required. A endpoint with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ServiceDirectory\V1\Endpoint $var + * @return $this + */ + public function setEndpoint($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1\Endpoint::class); + $this->endpoint = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateNamespaceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateNamespaceRequest.php new file mode 100644 index 00000000000..3cc325452b4 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateNamespaceRequest.php @@ -0,0 +1,199 @@ +google.cloud.servicedirectory.v1.CreateNamespaceRequest + */ +class CreateNamespaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the project and location the namespace + * will be created in. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $namespace_id = ''; + /** + * Required. A namespace with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $namespace = null; + + /** + * @param string $parent Required. The resource name of the project and location the namespace + * will be created in. Please see + * {@see RegistrationServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\ServiceDirectory\V1\PBNamespace $namespace Required. A namespace with initial fields set. + * @param string $namespaceId Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * @return \Google\Cloud\ServiceDirectory\V1\CreateNamespaceRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\ServiceDirectory\V1\PBNamespace $namespace, string $namespaceId): self + { + return (new self()) + ->setParent($parent) + ->setNamespace($namespace) + ->setNamespaceId($namespaceId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the project and location the namespace + * will be created in. + * @type string $namespace_id + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * @type \Google\Cloud\ServiceDirectory\V1\PBNamespace $namespace + * Required. A namespace with initial fields set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the project and location the namespace + * will be created in. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the project and location the namespace + * will be created in. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNamespaceId() + { + return $this->namespace_id; + } + + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNamespaceId($var) + { + GPBUtil::checkString($var, True); + $this->namespace_id = $var; + + return $this; + } + + /** + * Required. A namespace with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ServiceDirectory\V1\PBNamespace|null + */ + public function getNamespace() + { + return $this->namespace; + } + + public function hasNamespace() + { + return isset($this->namespace); + } + + public function clearNamespace() + { + unset($this->namespace); + } + + /** + * Required. A namespace with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ServiceDirectory\V1\PBNamespace $var + * @return $this + */ + public function setNamespace($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1\PBNamespace::class); + $this->namespace = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateServiceRequest.php new file mode 100644 index 00000000000..2dadd01b1ae --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateServiceRequest.php @@ -0,0 +1,194 @@ +google.cloud.servicedirectory.v1.CreateServiceRequest + */ +class CreateServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the namespace this service will belong to. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service_id = ''; + /** + * Required. A service with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service = null; + + /** + * @param string $parent Required. The resource name of the namespace this service will belong to. Please see + * {@see RegistrationServiceClient::namespaceName()} for help formatting this field. + * @param \Google\Cloud\ServiceDirectory\V1\Service $service Required. A service with initial fields set. + * @param string $serviceId Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * @return \Google\Cloud\ServiceDirectory\V1\CreateServiceRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\ServiceDirectory\V1\Service $service, string $serviceId): self + { + return (new self()) + ->setParent($parent) + ->setService($service) + ->setServiceId($serviceId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the namespace this service will belong to. + * @type string $service_id + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * @type \Google\Cloud\ServiceDirectory\V1\Service $service + * Required. A service with initial fields set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the namespace this service will belong to. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the namespace this service will belong to. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getServiceId() + { + return $this->service_id; + } + + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setServiceId($var) + { + GPBUtil::checkString($var, True); + $this->service_id = $var; + + return $this; + } + + /** + * Required. A service with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ServiceDirectory\V1\Service|null + */ + public function getService() + { + return $this->service; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Required. A service with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ServiceDirectory\V1\Service $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1\Service::class); + $this->service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteEndpointRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteEndpointRequest.php new file mode 100644 index 00000000000..b2c6e030a32 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteEndpointRequest.php @@ -0,0 +1,82 @@ +google.cloud.servicedirectory.v1.DeleteEndpointRequest + */ +class DeleteEndpointRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the endpoint to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the endpoint to delete. Please see + * {@see RegistrationServiceClient::endpointName()} for help formatting this field. + * + * @return \Google\Cloud\ServiceDirectory\V1\DeleteEndpointRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the endpoint to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the endpoint to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the endpoint to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteNamespaceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteNamespaceRequest.php new file mode 100644 index 00000000000..30a5b39f2b0 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteNamespaceRequest.php @@ -0,0 +1,82 @@ +google.cloud.servicedirectory.v1.DeleteNamespaceRequest + */ +class DeleteNamespaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the namespace to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the namespace to delete. Please see + * {@see RegistrationServiceClient::namespaceName()} for help formatting this field. + * + * @return \Google\Cloud\ServiceDirectory\V1\DeleteNamespaceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the namespace to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the namespace to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the namespace to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteServiceRequest.php new file mode 100644 index 00000000000..06c9a513015 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteServiceRequest.php @@ -0,0 +1,82 @@ +google.cloud.servicedirectory.v1.DeleteServiceRequest + */ +class DeleteServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the service to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the service to delete. Please see + * {@see RegistrationServiceClient::serviceName()} for help formatting this field. + * + * @return \Google\Cloud\ServiceDirectory\V1\DeleteServiceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the service to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the service to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the service to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/Endpoint.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/Endpoint.php new file mode 100644 index 00000000000..ae05e9afd6d --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/Endpoint.php @@ -0,0 +1,359 @@ +google.cloud.servicedirectory.v1.Endpoint + */ +class Endpoint extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The resource name for the endpoint in the format + * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + * like: + * * `8.8.8` + * * `8.8.8.8:53` + * * `test:bad:address` + * * `[::1]` + * * `[::1]:8080` + * Limited to 45 characters. + * + * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $address = ''; + /** + * Optional. Service Directory rejects values outside of `[0, 65535]`. + * + * Generated from protobuf field int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $port = 0; + /** + * Optional. Annotations for the endpoint. This data can be consumed by + * service clients. + * Restrictions: + * * The entire annotations dictionary may contain up to 512 characters, + * spread accoss all key-value pairs. Annotations that go beyond this + * limit are rejected + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/) + * Annotations that fails to meet these requirements are rejected. + * Note: This field is equivalent to the `metadata` field in the v1beta1 API. + * They have the same syntax and read/write to the same location in Service + * Directory. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; + /** + * Immutable. The Google Compute Engine network (VPC) of the endpoint in the + * format `projects//locations/global/networks/*`. + * The project must be specified by project number (project id is rejected). + * Incorrectly formatted networks are rejected, we also check to make sure + * that you have the servicedirectory.networks.attach permission on the + * project specified. + * + * Generated from protobuf field string network = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $network = ''; + /** + * Output only. The globally unique identifier of the endpoint in the UUID4 + * format. + * + * Generated from protobuf field string uid = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. The resource name for the endpoint in the format + * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + * @type string $address + * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + * like: + * * `8.8.8` + * * `8.8.8.8:53` + * * `test:bad:address` + * * `[::1]` + * * `[::1]:8080` + * Limited to 45 characters. + * @type int $port + * Optional. Service Directory rejects values outside of `[0, 65535]`. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. Annotations for the endpoint. This data can be consumed by + * service clients. + * Restrictions: + * * The entire annotations dictionary may contain up to 512 characters, + * spread accoss all key-value pairs. Annotations that go beyond this + * limit are rejected + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/) + * Annotations that fails to meet these requirements are rejected. + * Note: This field is equivalent to the `metadata` field in the v1beta1 API. + * They have the same syntax and read/write to the same location in Service + * Directory. + * @type string $network + * Immutable. The Google Compute Engine network (VPC) of the endpoint in the + * format `projects//locations/global/networks/*`. + * The project must be specified by project number (project id is rejected). + * Incorrectly formatted networks are rejected, we also check to make sure + * that you have the servicedirectory.networks.attach permission on the + * project specified. + * @type string $uid + * Output only. The globally unique identifier of the endpoint in the UUID4 + * format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\Endpoint::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The resource name for the endpoint in the format + * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. The resource name for the endpoint in the format + * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + * like: + * * `8.8.8` + * * `8.8.8.8:53` + * * `test:bad:address` + * * `[::1]` + * * `[::1]:8080` + * Limited to 45 characters. + * + * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + * like: + * * `8.8.8` + * * `8.8.8.8:53` + * * `test:bad:address` + * * `[::1]` + * * `[::1]:8080` + * Limited to 45 characters. + * + * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $var; + + return $this; + } + + /** + * Optional. Service Directory rejects values outside of `[0, 65535]`. + * + * Generated from protobuf field int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPort() + { + return $this->port; + } + + /** + * Optional. Service Directory rejects values outside of `[0, 65535]`. + * + * Generated from protobuf field int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + + /** + * Optional. Annotations for the endpoint. This data can be consumed by + * service clients. + * Restrictions: + * * The entire annotations dictionary may contain up to 512 characters, + * spread accoss all key-value pairs. Annotations that go beyond this + * limit are rejected + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/) + * Annotations that fails to meet these requirements are rejected. + * Note: This field is equivalent to the `metadata` field in the v1beta1 API. + * They have the same syntax and read/write to the same location in Service + * Directory. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. Annotations for the endpoint. This data can be consumed by + * service clients. + * Restrictions: + * * The entire annotations dictionary may contain up to 512 characters, + * spread accoss all key-value pairs. Annotations that go beyond this + * limit are rejected + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/) + * Annotations that fails to meet these requirements are rejected. + * Note: This field is equivalent to the `metadata` field in the v1beta1 API. + * They have the same syntax and read/write to the same location in Service + * Directory. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Immutable. The Google Compute Engine network (VPC) of the endpoint in the + * format `projects//locations/global/networks/*`. + * The project must be specified by project number (project id is rejected). + * Incorrectly formatted networks are rejected, we also check to make sure + * that you have the servicedirectory.networks.attach permission on the + * project specified. + * + * Generated from protobuf field string network = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Immutable. The Google Compute Engine network (VPC) of the endpoint in the + * format `projects//locations/global/networks/*`. + * The project must be specified by project number (project id is rejected). + * Incorrectly formatted networks are rejected, we also check to make sure + * that you have the servicedirectory.networks.attach permission on the + * project specified. + * + * Generated from protobuf field string network = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Output only. The globally unique identifier of the endpoint in the UUID4 + * format. + * + * Generated from protobuf field string uid = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. The globally unique identifier of the endpoint in the UUID4 + * format. + * + * Generated from protobuf field string uid = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetEndpointRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetEndpointRequest.php new file mode 100644 index 00000000000..5be9f51563f --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetEndpointRequest.php @@ -0,0 +1,84 @@ +google.cloud.servicedirectory.v1.GetEndpointRequest + */ +class GetEndpointRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the endpoint to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the endpoint to get. Please see + * {@see RegistrationServiceClient::endpointName()} for help formatting this field. + * + * @return \Google\Cloud\ServiceDirectory\V1\GetEndpointRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the endpoint to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the endpoint to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the endpoint to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetNamespaceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetNamespaceRequest.php new file mode 100644 index 00000000000..d5cd6575043 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetNamespaceRequest.php @@ -0,0 +1,82 @@ +google.cloud.servicedirectory.v1.GetNamespaceRequest + */ +class GetNamespaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the namespace to retrieve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the namespace to retrieve. Please see + * {@see RegistrationServiceClient::namespaceName()} for help formatting this field. + * + * @return \Google\Cloud\ServiceDirectory\V1\GetNamespaceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the namespace to retrieve. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the namespace to retrieve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the namespace to retrieve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetServiceRequest.php new file mode 100644 index 00000000000..2762f237541 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetServiceRequest.php @@ -0,0 +1,84 @@ +google.cloud.servicedirectory.v1.GetServiceRequest + */ +class GetServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the service to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the service to get. Please see + * {@see RegistrationServiceClient::serviceName()} for help formatting this field. + * + * @return \Google\Cloud\ServiceDirectory\V1\GetServiceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the service to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the service to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the service to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListEndpointsRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListEndpointsRequest.php new file mode 100644 index 00000000000..00c7d5ca1bc --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListEndpointsRequest.php @@ -0,0 +1,359 @@ +google.cloud.servicedirectory.v1.ListEndpointsRequest + */ +class ListEndpointsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the service whose endpoints you'd like to + * list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoints, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows values: `name`, `address`, `port` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The resource name of the service whose endpoints you'd like to + * list. Please see + * {@see RegistrationServiceClient::serviceName()} for help formatting this field. + * + * @return \Google\Cloud\ServiceDirectory\V1\ListEndpointsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the service whose endpoints you'd like to + * list. + * @type int $page_size + * Optional. The maximum number of items to return. + * @type string $page_token + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @type string $filter + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoints, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type string $order_by + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows values: `name`, `address`, `port` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the service whose endpoints you'd like to + * list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the service whose endpoints you'd like to + * list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoints, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoints, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows values: `name`, `address`, `port` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows values: `name`, `address`, `port` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListEndpointsResponse.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListEndpointsResponse.php new file mode 100644 index 00000000000..152be5d2d97 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListEndpointsResponse.php @@ -0,0 +1,106 @@ +google.cloud.servicedirectory.v1.ListEndpointsResponse + */ +class ListEndpointsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of endpoints. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + */ + private $endpoints; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ServiceDirectory\V1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $endpoints + * The list of endpoints. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * The list of endpoints. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEndpoints() + { + return $this->endpoints; + } + + /** + * The list of endpoints. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + * @param array<\Google\Cloud\ServiceDirectory\V1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEndpoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceDirectory\V1\Endpoint::class); + $this->endpoints = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListNamespacesRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListNamespacesRequest.php new file mode 100644 index 00000000000..6ac230b09ec --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListNamespacesRequest.php @@ -0,0 +1,339 @@ +google.cloud.servicedirectory.v1.ListNamespacesRequest + */ +class ListNamespacesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the project and location whose namespaces + * you'd like to list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `labels.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `labels.owner` returns namespaces that have a label with the key + * `owner`, this is the same as `labels:owner` + * * `labels.owner=sd` returns namespaces that have key/value + * `owner=sd` + * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + * returns namespaces that have name that is alphabetically later than the + * string, so "namespace-e" is returned but "namespace-a" is not + * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + * `owner` in label key but value is not `sd` AND have key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that namespace + * doesn't have a field called "doesnotexist". Since the filter does not + * match any namespaces, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The resource name of the project and location whose namespaces + * you'd like to list. Please see + * {@see RegistrationServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\ServiceDirectory\V1\ListNamespacesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the project and location whose namespaces + * you'd like to list. + * @type int $page_size + * Optional. The maximum number of items to return. + * @type string $page_token + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @type string $filter + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `labels.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `labels.owner` returns namespaces that have a label with the key + * `owner`, this is the same as `labels:owner` + * * `labels.owner=sd` returns namespaces that have key/value + * `owner=sd` + * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + * returns namespaces that have name that is alphabetically later than the + * string, so "namespace-e" is returned but "namespace-a" is not + * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + * `owner` in label key but value is not `sd` AND have key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that namespace + * doesn't have a field called "doesnotexist". Since the filter does not + * match any namespaces, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type string $order_by + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the project and location whose namespaces + * you'd like to list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the project and location whose namespaces + * you'd like to list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `labels.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `labels.owner` returns namespaces that have a label with the key + * `owner`, this is the same as `labels:owner` + * * `labels.owner=sd` returns namespaces that have key/value + * `owner=sd` + * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + * returns namespaces that have name that is alphabetically later than the + * string, so "namespace-e" is returned but "namespace-a" is not + * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + * `owner` in label key but value is not `sd` AND have key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that namespace + * doesn't have a field called "doesnotexist". Since the filter does not + * match any namespaces, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `labels.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `labels.owner` returns namespaces that have a label with the key + * `owner`, this is the same as `labels:owner` + * * `labels.owner=sd` returns namespaces that have key/value + * `owner=sd` + * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + * returns namespaces that have name that is alphabetically later than the + * string, so "namespace-e" is returned but "namespace-a" is not + * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + * `owner` in label key but value is not `sd` AND have key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that namespace + * doesn't have a field called "doesnotexist". Since the filter does not + * match any namespaces, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListNamespacesResponse.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListNamespacesResponse.php new file mode 100644 index 00000000000..46926f93463 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListNamespacesResponse.php @@ -0,0 +1,106 @@ +google.cloud.servicedirectory.v1.ListNamespacesResponse + */ +class ListNamespacesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of namespaces. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + */ + private $namespaces; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ServiceDirectory\V1\PBNamespace>|\Google\Protobuf\Internal\RepeatedField $namespaces + * The list of namespaces. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * The list of namespaces. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNamespaces() + { + return $this->namespaces; + } + + /** + * The list of namespaces. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + * @param array<\Google\Cloud\ServiceDirectory\V1\PBNamespace>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNamespaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceDirectory\V1\PBNamespace::class); + $this->namespaces = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListServicesRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListServicesRequest.php new file mode 100644 index 00000000000..03bf23b1191 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListServicesRequest.php @@ -0,0 +1,347 @@ +google.cloud.servicedirectory.v1.ListServicesRequest + */ +class ListServicesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the namespace whose services you'd + * like to list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `annotations.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `annotations.owner` returns services that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns services that have key/value + * `protocol=gRPC` + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + * returns services that have name that is alphabetically later than the + * string, so "service-e" is returned but "service-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns services that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that service + * doesn't have a field called "doesnotexist". Since the filter does not + * match any services, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The resource name of the namespace whose services you'd + * like to list. Please see + * {@see RegistrationServiceClient::namespaceName()} for help formatting this field. + * + * @return \Google\Cloud\ServiceDirectory\V1\ListServicesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the namespace whose services you'd + * like to list. + * @type int $page_size + * Optional. The maximum number of items to return. + * @type string $page_token + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @type string $filter + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `annotations.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `annotations.owner` returns services that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns services that have key/value + * `protocol=gRPC` + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + * returns services that have name that is alphabetically later than the + * string, so "service-e" is returned but "service-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns services that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that service + * doesn't have a field called "doesnotexist". Since the filter does not + * match any services, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type string $order_by + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the namespace whose services you'd + * like to list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the namespace whose services you'd + * like to list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `annotations.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `annotations.owner` returns services that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns services that have key/value + * `protocol=gRPC` + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + * returns services that have name that is alphabetically later than the + * string, so "service-e" is returned but "service-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns services that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that service + * doesn't have a field called "doesnotexist". Since the filter does not + * match any services, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `annotations.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `annotations.owner` returns services that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns services that have key/value + * `protocol=gRPC` + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + * returns services that have name that is alphabetically later than the + * string, so "service-e" is returned but "service-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns services that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that service + * doesn't have a field called "doesnotexist". Since the filter does not + * match any services, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListServicesResponse.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListServicesResponse.php new file mode 100644 index 00000000000..b0956b8c2b2 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListServicesResponse.php @@ -0,0 +1,106 @@ +google.cloud.servicedirectory.v1.ListServicesResponse + */ +class ListServicesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of services. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Service services = 1; + */ + private $services; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ServiceDirectory\V1\Service>|\Google\Protobuf\Internal\RepeatedField $services + * The list of services. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * The list of services. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Service services = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServices() + { + return $this->services; + } + + /** + * The list of services. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Service services = 1; + * @param array<\Google\Cloud\ServiceDirectory\V1\Service>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceDirectory\V1\Service::class); + $this->services = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/PBNamespace.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/PBNamespace.php new file mode 100644 index 00000000000..d2fa30c5d03 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/PBNamespace.php @@ -0,0 +1,153 @@ +google.cloud.servicedirectory.v1.Namespace + */ +class PBNamespace extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The resource name for the namespace in the format + * `projects/*/locations/*/namespaces/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Optional. Resource labels associated with this namespace. + * No more than 64 user labels can be associated with a given resource. Label + * keys and values can be no longer than 63 characters. + * + * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. The globally unique identifier of the namespace in the UUID4 + * format. + * + * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. The resource name for the namespace in the format + * `projects/*/locations/*/namespaces/*`. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Resource labels associated with this namespace. + * No more than 64 user labels can be associated with a given resource. Label + * keys and values can be no longer than 63 characters. + * @type string $uid + * Output only. The globally unique identifier of the namespace in the UUID4 + * format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\PBNamespace::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The resource name for the namespace in the format + * `projects/*/locations/*/namespaces/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. The resource name for the namespace in the format + * `projects/*/locations/*/namespaces/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Resource labels associated with this namespace. + * No more than 64 user labels can be associated with a given resource. Label + * keys and values can be no longer than 63 characters. + * + * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Resource labels associated with this namespace. + * No more than 64 user labels can be associated with a given resource. Label + * keys and values can be no longer than 63 characters. + * + * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. The globally unique identifier of the namespace in the UUID4 + * format. + * + * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. The globally unique identifier of the namespace in the UUID4 + * format. + * + * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ResolveServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ResolveServiceRequest.php new file mode 100644 index 00000000000..8ce1366ea90 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ResolveServiceRequest.php @@ -0,0 +1,265 @@ +google.cloud.servicedirectory.v1.ResolveServiceRequest + */ +class ResolveServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the service to resolve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The maximum number of endpoints to return. Defaults to 25. + * Maximum is 100. If a value less than one is specified, the Default is used. + * If a value greater than the Maximum is specified, the Maximum is used. + * + * Generated from protobuf field int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_endpoints = 0; + /** + * Optional. The filter applied to the endpoints of the resolved service. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoint, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $endpoint_filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the service to resolve. + * @type int $max_endpoints + * Optional. The maximum number of endpoints to return. Defaults to 25. + * Maximum is 100. If a value less than one is specified, the Default is used. + * If a value greater than the Maximum is specified, the Maximum is used. + * @type string $endpoint_filter + * Optional. The filter applied to the endpoints of the resolved service. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoint, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\LookupService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the service to resolve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the service to resolve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The maximum number of endpoints to return. Defaults to 25. + * Maximum is 100. If a value less than one is specified, the Default is used. + * If a value greater than the Maximum is specified, the Maximum is used. + * + * Generated from protobuf field int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMaxEndpoints() + { + return $this->max_endpoints; + } + + /** + * Optional. The maximum number of endpoints to return. Defaults to 25. + * Maximum is 100. If a value less than one is specified, the Default is used. + * If a value greater than the Maximum is specified, the Maximum is used. + * + * Generated from protobuf field int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMaxEndpoints($var) + { + GPBUtil::checkInt32($var); + $this->max_endpoints = $var; + + return $this; + } + + /** + * Optional. The filter applied to the endpoints of the resolved service. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoint, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEndpointFilter() + { + return $this->endpoint_filter; + } + + /** + * Optional. The filter applied to the endpoints of the resolved service. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoint, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEndpointFilter($var) + { + GPBUtil::checkString($var, True); + $this->endpoint_filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ResolveServiceResponse.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ResolveServiceResponse.php new file mode 100644 index 00000000000..63fa97718ca --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ResolveServiceResponse.php @@ -0,0 +1,71 @@ +google.cloud.servicedirectory.v1.ResolveServiceResponse + */ +class ResolveServiceResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 1; + */ + protected $service = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ServiceDirectory\V1\Service $service + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\LookupService::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 1; + * @return \Google\Cloud\ServiceDirectory\V1\Service|null + */ + public function getService() + { + return $this->service; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 1; + * @param \Google\Cloud\ServiceDirectory\V1\Service $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1\Service::class); + $this->service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/Service.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/Service.php new file mode 100644 index 00000000000..33f8d1b6b89 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/Service.php @@ -0,0 +1,256 @@ +google.cloud.servicedirectory.v1.Service + */ +class Service extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The resource name for the service in the format + * `projects/*/locations/*/namespaces/*/services/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Optional. Annotations for the service. This data can be consumed by service + * clients. + * Restrictions: + * * The entire annotations dictionary may contain up to 2000 characters, + * spread accoss all key-value pairs. Annotations that go beyond this + * limit are rejected + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/). + * Annotations that fails to meet these requirements are rejected + * Note: This field is equivalent to the `metadata` field in the v1beta1 API. + * They have the same syntax and read/write to the same location in Service + * Directory. + * + * Generated from protobuf field map annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; + /** + * Output only. Endpoints associated with this service. Returned on + * [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService]. + * Control plane clients should use + * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints]. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $endpoints; + /** + * Output only. The globally unique identifier of the service in the UUID4 + * format. + * + * Generated from protobuf field string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. The resource name for the service in the format + * `projects/*/locations/*/namespaces/*/services/*`. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. Annotations for the service. This data can be consumed by service + * clients. + * Restrictions: + * * The entire annotations dictionary may contain up to 2000 characters, + * spread accoss all key-value pairs. Annotations that go beyond this + * limit are rejected + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/). + * Annotations that fails to meet these requirements are rejected + * Note: This field is equivalent to the `metadata` field in the v1beta1 API. + * They have the same syntax and read/write to the same location in Service + * Directory. + * @type array<\Google\Cloud\ServiceDirectory\V1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $endpoints + * Output only. Endpoints associated with this service. Returned on + * [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService]. + * Control plane clients should use + * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints]. + * @type string $uid + * Output only. The globally unique identifier of the service in the UUID4 + * format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The resource name for the service in the format + * `projects/*/locations/*/namespaces/*/services/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. The resource name for the service in the format + * `projects/*/locations/*/namespaces/*/services/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Annotations for the service. This data can be consumed by service + * clients. + * Restrictions: + * * The entire annotations dictionary may contain up to 2000 characters, + * spread accoss all key-value pairs. Annotations that go beyond this + * limit are rejected + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/). + * Annotations that fails to meet these requirements are rejected + * Note: This field is equivalent to the `metadata` field in the v1beta1 API. + * They have the same syntax and read/write to the same location in Service + * Directory. + * + * Generated from protobuf field map annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. Annotations for the service. This data can be consumed by service + * clients. + * Restrictions: + * * The entire annotations dictionary may contain up to 2000 characters, + * spread accoss all key-value pairs. Annotations that go beyond this + * limit are rejected + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/). + * Annotations that fails to meet these requirements are rejected + * Note: This field is equivalent to the `metadata` field in the v1beta1 API. + * They have the same syntax and read/write to the same location in Service + * Directory. + * + * Generated from protobuf field map annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. Endpoints associated with this service. Returned on + * [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService]. + * Control plane clients should use + * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints]. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEndpoints() + { + return $this->endpoints; + } + + /** + * Output only. Endpoints associated with this service. Returned on + * [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService]. + * Control plane clients should use + * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints]. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\ServiceDirectory\V1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEndpoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceDirectory\V1\Endpoint::class); + $this->endpoints = $arr; + + return $this; + } + + /** + * Output only. The globally unique identifier of the service in the UUID4 + * format. + * + * Generated from protobuf field string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. The globally unique identifier of the service in the UUID4 + * format. + * + * Generated from protobuf field string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateEndpointRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateEndpointRequest.php new file mode 100644 index 00000000000..6c294424f3f --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateEndpointRequest.php @@ -0,0 +1,137 @@ +google.cloud.servicedirectory.v1.UpdateEndpointRequest + */ +class UpdateEndpointRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The updated endpoint. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $endpoint = null; + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\ServiceDirectory\V1\Endpoint $endpoint Required. The updated endpoint. + * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields to be updated in this request. + * + * @return \Google\Cloud\ServiceDirectory\V1\UpdateEndpointRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ServiceDirectory\V1\Endpoint $endpoint, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setEndpoint($endpoint) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ServiceDirectory\V1\Endpoint $endpoint + * Required. The updated endpoint. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. List of fields to be updated in this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The updated endpoint. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ServiceDirectory\V1\Endpoint|null + */ + public function getEndpoint() + { + return $this->endpoint; + } + + public function hasEndpoint() + { + return isset($this->endpoint); + } + + public function clearEndpoint() + { + unset($this->endpoint); + } + + /** + * Required. The updated endpoint. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ServiceDirectory\V1\Endpoint $var + * @return $this + */ + public function setEndpoint($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1\Endpoint::class); + $this->endpoint = $var; + + return $this; + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateNamespaceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateNamespaceRequest.php new file mode 100644 index 00000000000..499e2528df7 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateNamespaceRequest.php @@ -0,0 +1,137 @@ +google.cloud.servicedirectory.v1.UpdateNamespaceRequest + */ +class UpdateNamespaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The updated namespace. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $namespace = null; + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\ServiceDirectory\V1\PBNamespace $namespace Required. The updated namespace. + * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields to be updated in this request. + * + * @return \Google\Cloud\ServiceDirectory\V1\UpdateNamespaceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ServiceDirectory\V1\PBNamespace $namespace, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setNamespace($namespace) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ServiceDirectory\V1\PBNamespace $namespace + * Required. The updated namespace. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. List of fields to be updated in this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The updated namespace. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ServiceDirectory\V1\PBNamespace|null + */ + public function getNamespace() + { + return $this->namespace; + } + + public function hasNamespace() + { + return isset($this->namespace); + } + + public function clearNamespace() + { + unset($this->namespace); + } + + /** + * Required. The updated namespace. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ServiceDirectory\V1\PBNamespace $var + * @return $this + */ + public function setNamespace($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1\PBNamespace::class); + $this->namespace = $var; + + return $this; + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateServiceRequest.php new file mode 100644 index 00000000000..b71bc24db98 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateServiceRequest.php @@ -0,0 +1,137 @@ +google.cloud.servicedirectory.v1.UpdateServiceRequest + */ +class UpdateServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The updated service. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service = null; + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\ServiceDirectory\V1\Service $service Required. The updated service. + * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields to be updated in this request. + * + * @return \Google\Cloud\ServiceDirectory\V1\UpdateServiceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ServiceDirectory\V1\Service $service, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setService($service) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ServiceDirectory\V1\Service $service + * Required. The updated service. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. List of fields to be updated in this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The updated service. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ServiceDirectory\V1\Service|null + */ + public function getService() + { + return $this->service; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Required. The updated service. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ServiceDirectory\V1\Service $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1\Service::class); + $this->service = $var; + + return $this; + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/get_location.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/get_location.php new file mode 100644 index 00000000000..7ff8abf83f7 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END servicedirectory_v1_generated_LookupService_GetLocation_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/list_locations.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/list_locations.php new file mode 100644 index 00000000000..d10d04f7ce9 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END servicedirectory_v1_generated_LookupService_ListLocations_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/resolve_service.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/resolve_service.php new file mode 100644 index 00000000000..f84de20cf94 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/resolve_service.php @@ -0,0 +1,73 @@ +resolveService($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = LookupServiceClient::serviceName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]', + '[SERVICE]' + ); + + resolve_service_sample($formattedName); +} +// [END servicedirectory_v1_generated_LookupService_ResolveService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_endpoint.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_endpoint.php new file mode 100644 index 00000000000..3fa08ba2044 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_endpoint.php @@ -0,0 +1,82 @@ +RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + */ +function create_endpoint_sample(string $formattedParent, string $endpointId): void +{ + // Create a client. + $registrationServiceClient = new RegistrationServiceClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $endpoint = new Endpoint(); + + // Call the API and handle any network failures. + try { + /** @var Endpoint $response */ + $response = $registrationServiceClient->createEndpoint($formattedParent, $endpointId, $endpoint); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RegistrationServiceClient::serviceName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]', + '[SERVICE]' + ); + $endpointId = '[ENDPOINT_ID]'; + + create_endpoint_sample($formattedParent, $endpointId); +} +// [END servicedirectory_v1_generated_RegistrationService_CreateEndpoint_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_namespace.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_namespace.php new file mode 100644 index 00000000000..cc07f6be4d7 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_namespace.php @@ -0,0 +1,78 @@ +RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + */ +function create_namespace_sample(string $formattedParent, string $namespaceId): void +{ + // Create a client. + $registrationServiceClient = new RegistrationServiceClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $namespace = new PBNamespace(); + + // Call the API and handle any network failures. + try { + /** @var PBNamespace $response */ + $response = $registrationServiceClient->createNamespace($formattedParent, $namespaceId, $namespace); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RegistrationServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $namespaceId = '[NAMESPACE_ID]'; + + create_namespace_sample($formattedParent, $namespaceId); +} +// [END servicedirectory_v1_generated_RegistrationService_CreateNamespace_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_service.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_service.php new file mode 100644 index 00000000000..45f6c1d1550 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_service.php @@ -0,0 +1,81 @@ +RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + */ +function create_service_sample(string $formattedParent, string $serviceId): void +{ + // Create a client. + $registrationServiceClient = new RegistrationServiceClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $service = new Service(); + + // Call the API and handle any network failures. + try { + /** @var Service $response */ + $response = $registrationServiceClient->createService($formattedParent, $serviceId, $service); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RegistrationServiceClient::namespaceName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]' + ); + $serviceId = '[SERVICE_ID]'; + + create_service_sample($formattedParent, $serviceId); +} +// [END servicedirectory_v1_generated_RegistrationService_CreateService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_endpoint.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_endpoint.php new file mode 100644 index 00000000000..41eb4fadeed --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_endpoint.php @@ -0,0 +1,70 @@ +deleteEndpoint($formattedName); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RegistrationServiceClient::endpointName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]', + '[SERVICE]', + '[ENDPOINT]' + ); + + delete_endpoint_sample($formattedName); +} +// [END servicedirectory_v1_generated_RegistrationService_DeleteEndpoint_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_namespace.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_namespace.php new file mode 100644 index 00000000000..684802bf350 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_namespace.php @@ -0,0 +1,65 @@ +deleteNamespace($formattedName); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RegistrationServiceClient::namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + + delete_namespace_sample($formattedName); +} +// [END servicedirectory_v1_generated_RegistrationService_DeleteNamespace_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_service.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_service.php new file mode 100644 index 00000000000..6c1561f74b8 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_service.php @@ -0,0 +1,70 @@ +deleteService($formattedName); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RegistrationServiceClient::serviceName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]', + '[SERVICE]' + ); + + delete_service_sample($formattedName); +} +// [END servicedirectory_v1_generated_RegistrationService_DeleteService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_endpoint.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_endpoint.php new file mode 100644 index 00000000000..5d05a0ab60d --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_endpoint.php @@ -0,0 +1,72 @@ +getEndpoint($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RegistrationServiceClient::endpointName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]', + '[SERVICE]', + '[ENDPOINT]' + ); + + get_endpoint_sample($formattedName); +} +// [END servicedirectory_v1_generated_RegistrationService_GetEndpoint_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_iam_policy.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_iam_policy.php new file mode 100644 index 00000000000..6edc7638016 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_iam_policy.php @@ -0,0 +1,66 @@ +getIamPolicy($resource); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END servicedirectory_v1_generated_RegistrationService_GetIamPolicy_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_location.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_location.php new file mode 100644 index 00000000000..179d4cd3644 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END servicedirectory_v1_generated_RegistrationService_GetLocation_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_namespace.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_namespace.php new file mode 100644 index 00000000000..331361a13a6 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_namespace.php @@ -0,0 +1,66 @@ +getNamespace($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RegistrationServiceClient::namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + + get_namespace_sample($formattedName); +} +// [END servicedirectory_v1_generated_RegistrationService_GetNamespace_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_service.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_service.php new file mode 100644 index 00000000000..d76a6a6013e --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_service.php @@ -0,0 +1,71 @@ +getService($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RegistrationServiceClient::serviceName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]', + '[SERVICE]' + ); + + get_service_sample($formattedName); +} +// [END servicedirectory_v1_generated_RegistrationService_GetService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_endpoints.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_endpoints.php new file mode 100644 index 00000000000..d3237893e81 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_endpoints.php @@ -0,0 +1,77 @@ +listEndpoints($formattedParent); + + /** @var Endpoint $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RegistrationServiceClient::serviceName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]', + '[SERVICE]' + ); + + list_endpoints_sample($formattedParent); +} +// [END servicedirectory_v1_generated_RegistrationService_ListEndpoints_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_locations.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_locations.php new file mode 100644 index 00000000000..18b418b3e19 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END servicedirectory_v1_generated_RegistrationService_ListLocations_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_namespaces.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_namespaces.php new file mode 100644 index 00000000000..1e7cc3dc62d --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_namespaces.php @@ -0,0 +1,72 @@ +listNamespaces($formattedParent); + + /** @var PBNamespace $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RegistrationServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_namespaces_sample($formattedParent); +} +// [END servicedirectory_v1_generated_RegistrationService_ListNamespaces_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_services.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_services.php new file mode 100644 index 00000000000..645e7aac9ea --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_services.php @@ -0,0 +1,76 @@ +listServices($formattedParent); + + /** @var Service $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RegistrationServiceClient::namespaceName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]' + ); + + list_services_sample($formattedParent); +} +// [END servicedirectory_v1_generated_RegistrationService_ListServices_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/set_iam_policy.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/set_iam_policy.php new file mode 100644 index 00000000000..0646528eb18 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/set_iam_policy.php @@ -0,0 +1,69 @@ +setIamPolicy($resource, $policy); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END servicedirectory_v1_generated_RegistrationService_SetIamPolicy_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/test_iam_permissions.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/test_iam_permissions.php new file mode 100644 index 00000000000..04fc9f8e559 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/test_iam_permissions.php @@ -0,0 +1,74 @@ +testIamPermissions($resource, $permissions); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END servicedirectory_v1_generated_RegistrationService_TestIamPermissions_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_endpoint.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_endpoint.php new file mode 100644 index 00000000000..c517b9b17ee --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_endpoint.php @@ -0,0 +1,58 @@ +updateEndpoint($endpoint, $updateMask); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END servicedirectory_v1_generated_RegistrationService_UpdateEndpoint_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_namespace.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_namespace.php new file mode 100644 index 00000000000..4a41b969f5d --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_namespace.php @@ -0,0 +1,58 @@ +updateNamespace($namespace, $updateMask); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END servicedirectory_v1_generated_RegistrationService_UpdateNamespace_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_service.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_service.php new file mode 100644 index 00000000000..609eef14e6f --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_service.php @@ -0,0 +1,58 @@ +updateService($service, $updateMask); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END servicedirectory_v1_generated_RegistrationService_UpdateService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/BaseClient/LookupServiceBaseClient.php b/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/BaseClient/LookupServiceBaseClient.php new file mode 100644 index 00000000000..12b15170c47 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/BaseClient/LookupServiceBaseClient.php @@ -0,0 +1,296 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../../resources/lookup_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../../resources/lookup_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../../resources/lookup_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../../resources/lookup_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a service + * resource. + * + * @param string $project + * @param string $location + * @param string $namespace + * @param string $service + * + * @return string The formatted service resource. + */ + public static function serviceName(string $project, string $location, string $namespace, string $service): string + { + return self::getPathTemplate('service')->render([ + 'project' => $project, + 'location' => $location, + 'namespace' => $namespace, + 'service' => $service, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'servicedirectory.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Returns a [service][google.cloud.servicedirectory.v1.Service] and its + * associated endpoints. + * Resolving a service is not considered an active developer method. + * + * The async variant is {@see self::resolveServiceAsync()} . + * + * @param ResolveServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ResolveServiceResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function resolveService(ResolveServiceRequest $request, array $callOptions = []): ResolveServiceResponse + { + return $this->startApiCall('ResolveService', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see self::getLocationAsync()} . + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/BaseClient/RegistrationServiceBaseClient.php b/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/BaseClient/RegistrationServiceBaseClient.php new file mode 100644 index 00000000000..a5a368dd7bc --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/BaseClient/RegistrationServiceBaseClient.php @@ -0,0 +1,830 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../../resources/registration_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../../resources/registration_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../../resources/registration_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../../resources/registration_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a endpoint + * resource. + * + * @param string $project + * @param string $location + * @param string $namespace + * @param string $service + * @param string $endpoint + * + * @return string The formatted endpoint resource. + */ + public static function endpointName(string $project, string $location, string $namespace, string $service, string $endpoint): string + { + return self::getPathTemplate('endpoint')->render([ + 'project' => $project, + 'location' => $location, + 'namespace' => $namespace, + 'service' => $service, + 'endpoint' => $endpoint, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a namespace + * resource. + * + * @param string $project + * @param string $location + * @param string $namespace + * + * @return string The formatted namespace resource. + */ + public static function namespaceName(string $project, string $location, string $namespace): string + { + return self::getPathTemplate('namespace')->render([ + 'project' => $project, + 'location' => $location, + 'namespace' => $namespace, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $project + * @param string $network + * + * @return string The formatted network resource. + */ + public static function networkName(string $project, string $network): string + { + return self::getPathTemplate('network')->render([ + 'project' => $project, + 'network' => $network, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a service + * resource. + * + * @param string $project + * @param string $location + * @param string $namespace + * @param string $service + * + * @return string The formatted service resource. + */ + public static function serviceName(string $project, string $location, string $namespace, string $service): string + { + return self::getPathTemplate('service')->render([ + 'project' => $project, + 'location' => $location, + 'namespace' => $namespace, + 'service' => $service, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - endpoint: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint} + * - location: projects/{project}/locations/{location} + * - namespace: projects/{project}/locations/{location}/namespaces/{namespace} + * - network: projects/{project}/locations/global/networks/{network} + * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'servicedirectory.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates an endpoint, and returns the new endpoint. + * + * The async variant is {@see self::createEndpointAsync()} . + * + * @param CreateEndpointRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Endpoint + * + * @throws ApiException Thrown if the API call fails. + */ + public function createEndpoint(CreateEndpointRequest $request, array $callOptions = []): Endpoint + { + return $this->startApiCall('CreateEndpoint', $request, $callOptions)->wait(); + } + + /** + * Creates a namespace, and returns the new namespace. + * + * The async variant is {@see self::createNamespaceAsync()} . + * + * @param CreateNamespaceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PBNamespace + * + * @throws ApiException Thrown if the API call fails. + */ + public function createNamespace(CreateNamespaceRequest $request, array $callOptions = []): PBNamespace + { + return $this->startApiCall('CreateNamespace', $request, $callOptions)->wait(); + } + + /** + * Creates a service, and returns the new service. + * + * The async variant is {@see self::createServiceAsync()} . + * + * @param CreateServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Service + * + * @throws ApiException Thrown if the API call fails. + */ + public function createService(CreateServiceRequest $request, array $callOptions = []): Service + { + return $this->startApiCall('CreateService', $request, $callOptions)->wait(); + } + + /** + * Deletes an endpoint. + * + * The async variant is {@see self::deleteEndpointAsync()} . + * + * @param DeleteEndpointRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteEndpoint(DeleteEndpointRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteEndpoint', $request, $callOptions)->wait(); + } + + /** + * Deletes a namespace. This also deletes all services and endpoints in + * the namespace. + * + * The async variant is {@see self::deleteNamespaceAsync()} . + * + * @param DeleteNamespaceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteNamespace(DeleteNamespaceRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteNamespace', $request, $callOptions)->wait(); + } + + /** + * Deletes a service. This also deletes all endpoints associated with + * the service. + * + * The async variant is {@see self::deleteServiceAsync()} . + * + * @param DeleteServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteService(DeleteServiceRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteService', $request, $callOptions)->wait(); + } + + /** + * Gets an endpoint. + * + * The async variant is {@see self::getEndpointAsync()} . + * + * @param GetEndpointRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Endpoint + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEndpoint(GetEndpointRequest $request, array $callOptions = []): Endpoint + { + return $this->startApiCall('GetEndpoint', $request, $callOptions)->wait(); + } + + /** + * Gets the IAM Policy for a resource (namespace or service only). + * + * The async variant is {@see self::getIamPolicyAsync()} . + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Gets a namespace. + * + * The async variant is {@see self::getNamespaceAsync()} . + * + * @param GetNamespaceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PBNamespace + * + * @throws ApiException Thrown if the API call fails. + */ + public function getNamespace(GetNamespaceRequest $request, array $callOptions = []): PBNamespace + { + return $this->startApiCall('GetNamespace', $request, $callOptions)->wait(); + } + + /** + * Gets a service. + * + * The async variant is {@see self::getServiceAsync()} . + * + * @param GetServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Service + * + * @throws ApiException Thrown if the API call fails. + */ + public function getService(GetServiceRequest $request, array $callOptions = []): Service + { + return $this->startApiCall('GetService', $request, $callOptions)->wait(); + } + + /** + * Lists all endpoints. + * + * The async variant is {@see self::listEndpointsAsync()} . + * + * @param ListEndpointsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listEndpoints(ListEndpointsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListEndpoints', $request, $callOptions); + } + + /** + * Lists all namespaces. + * + * The async variant is {@see self::listNamespacesAsync()} . + * + * @param ListNamespacesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listNamespaces(ListNamespacesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListNamespaces', $request, $callOptions); + } + + /** + * Lists all services belonging to a namespace. + * + * The async variant is {@see self::listServicesAsync()} . + * + * @param ListServicesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listServices(ListServicesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListServices', $request, $callOptions); + } + + /** + * Sets the IAM Policy for a resource (namespace or service only). + * + * The async variant is {@see self::setIamPolicyAsync()} . + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Tests IAM permissions for a resource (namespace or service only). + * + * The async variant is {@see self::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates an endpoint. + * + * The async variant is {@see self::updateEndpointAsync()} . + * + * @param UpdateEndpointRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Endpoint + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateEndpoint(UpdateEndpointRequest $request, array $callOptions = []): Endpoint + { + return $this->startApiCall('UpdateEndpoint', $request, $callOptions)->wait(); + } + + /** + * Updates a namespace. + * + * The async variant is {@see self::updateNamespaceAsync()} . + * + * @param UpdateNamespaceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PBNamespace + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateNamespace(UpdateNamespaceRequest $request, array $callOptions = []): PBNamespace + { + return $this->startApiCall('UpdateNamespace', $request, $callOptions)->wait(); + } + + /** + * Updates a service. + * + * The async variant is {@see self::updateServiceAsync()} . + * + * @param UpdateServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Service + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateService(UpdateServiceRequest $request, array $callOptions = []): Service + { + return $this->startApiCall('UpdateService', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see self::getLocationAsync()} . + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/LookupServiceClient.php b/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/LookupServiceClient.php new file mode 100644 index 00000000000..0b4dca5b04b --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/LookupServiceClient.php @@ -0,0 +1,40 @@ +serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + * $response = $lookupServiceClient->resolveService($formattedName); + * } finally { + * $lookupServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\ServiceDirectory\V1\Client\LookupServiceClient} to use the new + * surface. + */ +class LookupServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.servicedirectory.v1.LookupService'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'servicedirectory.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $serviceNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/lookup_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/lookup_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/lookup_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/lookup_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getServiceNameTemplate() + { + if (self::$serviceNameTemplate == null) { + self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}'); + } + + return self::$serviceNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'service' => self::getServiceNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a service + * resource. + * + * @param string $project + * @param string $location + * @param string $namespace + * @param string $service + * + * @return string The formatted service resource. + */ + public static function serviceName($project, $location, $namespace, $service) + { + return self::getServiceNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'namespace' => $namespace, + 'service' => $service, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'servicedirectory.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Returns a [service][google.cloud.servicedirectory.v1.Service] and its + * associated endpoints. + * Resolving a service is not considered an active developer method. + * + * Sample code: + * ``` + * $lookupServiceClient = new LookupServiceClient(); + * try { + * $formattedName = $lookupServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + * $response = $lookupServiceClient->resolveService($formattedName); + * } finally { + * $lookupServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the service to resolve. + * @param array $optionalArgs { + * Optional. + * + * @type int $maxEndpoints + * Optional. The maximum number of endpoints to return. Defaults to 25. + * Maximum is 100. If a value less than one is specified, the Default is used. + * If a value greater than the Maximum is specified, the Maximum is used. + * @type string $endpointFilter + * Optional. The filter applied to the endpoints of the resolved service. + * + * General `filter` string syntax: + * ` ()` + * + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * + * Examples of valid filters: + * + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoint, it returns no results + * + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1\ResolveServiceResponse + * + * @throws ApiException if the remote call fails + */ + public function resolveService($name, array $optionalArgs = []) + { + $request = new ResolveServiceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['maxEndpoints'])) { + $request->setMaxEndpoints($optionalArgs['maxEndpoints']); + } + + if (isset($optionalArgs['endpointFilter'])) { + $request->setEndpointFilter($optionalArgs['endpointFilter']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('ResolveService', ResolveServiceResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $lookupServiceClient = new LookupServiceClient(); + * try { + * $response = $lookupServiceClient->getLocation(); + * } finally { + * $lookupServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $lookupServiceClient = new LookupServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $lookupServiceClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $lookupServiceClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $lookupServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/Gapic/RegistrationServiceGapicClient.php b/owl-bot-staging/ServiceDirectory/v1/src/V1/Gapic/RegistrationServiceGapicClient.php new file mode 100644 index 00000000000..30974f7f8c1 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/src/V1/Gapic/RegistrationServiceGapicClient.php @@ -0,0 +1,1561 @@ +serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + * $endpointId = 'endpoint_id'; + * $endpoint = new Endpoint(); + * $response = $registrationServiceClient->createEndpoint($formattedParent, $endpointId, $endpoint); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\ServiceDirectory\V1\Client\RegistrationServiceClient} to use the + * new surface. + */ +class RegistrationServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.servicedirectory.v1.RegistrationService'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'servicedirectory.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $endpointNameTemplate; + + private static $locationNameTemplate; + + private static $namespaceNameTemplate; + + private static $networkNameTemplate; + + private static $serviceNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/registration_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/registration_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/registration_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/registration_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getEndpointNameTemplate() + { + if (self::$endpointNameTemplate == null) { + self::$endpointNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}'); + } + + return self::$endpointNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getNamespaceNameTemplate() + { + if (self::$namespaceNameTemplate == null) { + self::$namespaceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}'); + } + + return self::$namespaceNameTemplate; + } + + private static function getNetworkNameTemplate() + { + if (self::$networkNameTemplate == null) { + self::$networkNameTemplate = new PathTemplate('projects/{project}/locations/global/networks/{network}'); + } + + return self::$networkNameTemplate; + } + + private static function getServiceNameTemplate() + { + if (self::$serviceNameTemplate == null) { + self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}'); + } + + return self::$serviceNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'endpoint' => self::getEndpointNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'namespace' => self::getNamespaceNameTemplate(), + 'network' => self::getNetworkNameTemplate(), + 'service' => self::getServiceNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a endpoint + * resource. + * + * @param string $project + * @param string $location + * @param string $namespace + * @param string $service + * @param string $endpoint + * + * @return string The formatted endpoint resource. + */ + public static function endpointName($project, $location, $namespace, $service, $endpoint) + { + return self::getEndpointNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'namespace' => $namespace, + 'service' => $service, + 'endpoint' => $endpoint, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a namespace + * resource. + * + * @param string $project + * @param string $location + * @param string $namespace + * + * @return string The formatted namespace resource. + */ + public static function namespaceName($project, $location, $namespace) + { + return self::getNamespaceNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'namespace' => $namespace, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $project + * @param string $network + * + * @return string The formatted network resource. + */ + public static function networkName($project, $network) + { + return self::getNetworkNameTemplate()->render([ + 'project' => $project, + 'network' => $network, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a service + * resource. + * + * @param string $project + * @param string $location + * @param string $namespace + * @param string $service + * + * @return string The formatted service resource. + */ + public static function serviceName($project, $location, $namespace, $service) + { + return self::getServiceNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'namespace' => $namespace, + 'service' => $service, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - endpoint: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint} + * - location: projects/{project}/locations/{location} + * - namespace: projects/{project}/locations/{location}/namespaces/{namespace} + * - network: projects/{project}/locations/global/networks/{network} + * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'servicedirectory.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Creates an endpoint, and returns the new endpoint. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedParent = $registrationServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + * $endpointId = 'endpoint_id'; + * $endpoint = new Endpoint(); + * $response = $registrationServiceClient->createEndpoint($formattedParent, $endpointId, $endpoint); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the service that this endpoint provides. + * @param string $endpointId Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * @param Endpoint $endpoint Required. A endpoint with initial fields set. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1\Endpoint + * + * @throws ApiException if the remote call fails + */ + public function createEndpoint($parent, $endpointId, $endpoint, array $optionalArgs = []) + { + $request = new CreateEndpointRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setEndpointId($endpointId); + $request->setEndpoint($endpoint); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateEndpoint', Endpoint::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a namespace, and returns the new namespace. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedParent = $registrationServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * $namespaceId = 'namespace_id'; + * $namespace = new PBNamespace(); + * $response = $registrationServiceClient->createNamespace($formattedParent, $namespaceId, $namespace); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the project and location the namespace + * will be created in. + * @param string $namespaceId Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * @param PBNamespace $namespace Required. A namespace with initial fields set. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1\PBNamespace + * + * @throws ApiException if the remote call fails + */ + public function createNamespace($parent, $namespaceId, $namespace, array $optionalArgs = []) + { + $request = new CreateNamespaceRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setNamespaceId($namespaceId); + $request->setNamespace($namespace); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateNamespace', PBNamespace::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a service, and returns the new service. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedParent = $registrationServiceClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + * $serviceId = 'service_id'; + * $service = new Service(); + * $response = $registrationServiceClient->createService($formattedParent, $serviceId, $service); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the namespace this service will belong to. + * @param string $serviceId Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * @param Service $service Required. A service with initial fields set. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1\Service + * + * @throws ApiException if the remote call fails + */ + public function createService($parent, $serviceId, $service, array $optionalArgs = []) + { + $request = new CreateServiceRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setServiceId($serviceId); + $request->setService($service); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateService', Service::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes an endpoint. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedName = $registrationServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); + * $registrationServiceClient->deleteEndpoint($formattedName); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the endpoint to delete. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteEndpoint($name, array $optionalArgs = []) + { + $request = new DeleteEndpointRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteEndpoint', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a namespace. This also deletes all services and endpoints in + * the namespace. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedName = $registrationServiceClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + * $registrationServiceClient->deleteNamespace($formattedName); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the namespace to delete. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteNamespace($name, array $optionalArgs = []) + { + $request = new DeleteNamespaceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteNamespace', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a service. This also deletes all endpoints associated with + * the service. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedName = $registrationServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + * $registrationServiceClient->deleteService($formattedName); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the service to delete. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteService($name, array $optionalArgs = []) + { + $request = new DeleteServiceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteService', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets an endpoint. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedName = $registrationServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); + * $response = $registrationServiceClient->getEndpoint($formattedName); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the endpoint to get. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1\Endpoint + * + * @throws ApiException if the remote call fails + */ + public function getEndpoint($name, array $optionalArgs = []) + { + $request = new GetEndpointRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetEndpoint', Endpoint::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the IAM Policy for a resource (namespace or service only). + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $resource = 'resource'; + * $response = $registrationServiceClient->getIamPolicy($resource); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param array $optionalArgs { + * Optional. + * + * @type GetPolicyOptions $options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($resource, array $optionalArgs = []) + { + $request = new GetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['options'])) { + $request->setOptions($optionalArgs['options']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a namespace. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedName = $registrationServiceClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + * $response = $registrationServiceClient->getNamespace($formattedName); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the namespace to retrieve. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1\PBNamespace + * + * @throws ApiException if the remote call fails + */ + public function getNamespace($name, array $optionalArgs = []) + { + $request = new GetNamespaceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetNamespace', PBNamespace::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a service. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedName = $registrationServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + * $response = $registrationServiceClient->getService($formattedName); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the service to get. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1\Service + * + * @throws ApiException if the remote call fails + */ + public function getService($name, array $optionalArgs = []) + { + $request = new GetServiceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetService', Service::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists all endpoints. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedParent = $registrationServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + * // Iterate over pages of elements + * $pagedResponse = $registrationServiceClient->listEndpoints($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $registrationServiceClient->listEndpoints($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the service whose endpoints you'd like to + * list. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. The filter to list results by. + * + * General `filter` string syntax: + * ` ()` + * + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * + * Examples of valid filters: + * + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoints, it returns no results + * + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type string $orderBy + * Optional. The order to list results by. + * + * General `order_by` string syntax: ` () (,)` + * + * * `` allows values: `name`, `address`, `port` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listEndpoints($parent, array $optionalArgs = []) + { + $request = new ListEndpointsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListEndpoints', $optionalArgs, ListEndpointsResponse::class, $request); + } + + /** + * Lists all namespaces. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedParent = $registrationServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $registrationServiceClient->listNamespaces($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $registrationServiceClient->listNamespaces($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the project and location whose namespaces + * you'd like to list. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. The filter to list results by. + * + * General `filter` string syntax: + * ` ()` + * + * * `` can be `name` or `labels.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * + * Examples of valid filters: + * + * * `labels.owner` returns namespaces that have a label with the key + * `owner`, this is the same as `labels:owner` + * * `labels.owner=sd` returns namespaces that have key/value + * `owner=sd` + * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + * returns namespaces that have name that is alphabetically later than the + * string, so "namespace-e" is returned but "namespace-a" is not + * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + * `owner` in label key but value is not `sd` AND have key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that namespace + * doesn't have a field called "doesnotexist". Since the filter does not + * match any namespaces, it returns no results + * + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type string $orderBy + * Optional. The order to list results by. + * + * General `order_by` string syntax: ` () (,)` + * + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listNamespaces($parent, array $optionalArgs = []) + { + $request = new ListNamespacesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListNamespaces', $optionalArgs, ListNamespacesResponse::class, $request); + } + + /** + * Lists all services belonging to a namespace. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedParent = $registrationServiceClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + * // Iterate over pages of elements + * $pagedResponse = $registrationServiceClient->listServices($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $registrationServiceClient->listServices($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the namespace whose services you'd + * like to list. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. The filter to list results by. + * + * General `filter` string syntax: + * ` ()` + * + * * `` can be `name` or `annotations.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * + * Examples of valid filters: + * + * * `annotations.owner` returns services that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns services that have key/value + * `protocol=gRPC` + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + * returns services that have name that is alphabetically later than the + * string, so "service-e" is returned but "service-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns services that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that service + * doesn't have a field called "doesnotexist". Since the filter does not + * match any services, it returns no results + * + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type string $orderBy + * Optional. The order to list results by. + * + * General `order_by` string syntax: ` () (,)` + * + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listServices($parent, array $optionalArgs = []) + { + $request = new ListServicesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListServices', $optionalArgs, ListServicesResponse::class, $request); + } + + /** + * Sets the IAM Policy for a resource (namespace or service only). + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $registrationServiceClient->setIamPolicy($resource, $policy); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($resource, $policy, array $optionalArgs = []) + { + $request = new SetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPolicy($policy); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Tests IAM permissions for a resource (namespace or service only). + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $registrationServiceClient->testIamPermissions($resource, $permissions); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $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[] $permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($resource, $permissions, array $optionalArgs = []) + { + $request = new TestIamPermissionsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPermissions($permissions); + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates an endpoint. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $endpoint = new Endpoint(); + * $updateMask = new FieldMask(); + * $response = $registrationServiceClient->updateEndpoint($endpoint, $updateMask); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param Endpoint $endpoint Required. The updated endpoint. + * @param FieldMask $updateMask Required. List of fields to be updated in this request. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1\Endpoint + * + * @throws ApiException if the remote call fails + */ + public function updateEndpoint($endpoint, $updateMask, array $optionalArgs = []) + { + $request = new UpdateEndpointRequest(); + $requestParamHeaders = []; + $request->setEndpoint($endpoint); + $request->setUpdateMask($updateMask); + $requestParamHeaders['endpoint.name'] = $endpoint->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateEndpoint', Endpoint::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates a namespace. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $namespace = new PBNamespace(); + * $updateMask = new FieldMask(); + * $response = $registrationServiceClient->updateNamespace($namespace, $updateMask); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param PBNamespace $namespace Required. The updated namespace. + * @param FieldMask $updateMask Required. List of fields to be updated in this request. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1\PBNamespace + * + * @throws ApiException if the remote call fails + */ + public function updateNamespace($namespace, $updateMask, array $optionalArgs = []) + { + $request = new UpdateNamespaceRequest(); + $requestParamHeaders = []; + $request->setNamespace($namespace); + $request->setUpdateMask($updateMask); + $requestParamHeaders['namespace.name'] = $namespace->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateNamespace', PBNamespace::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates a service. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $service = new Service(); + * $updateMask = new FieldMask(); + * $response = $registrationServiceClient->updateService($service, $updateMask); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param Service $service Required. The updated service. + * @param FieldMask $updateMask Required. List of fields to be updated in this request. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1\Service + * + * @throws ApiException if the remote call fails + */ + public function updateService($service, $updateMask, array $optionalArgs = []) + { + $request = new UpdateServiceRequest(); + $requestParamHeaders = []; + $request->setService($service); + $request->setUpdateMask($updateMask); + $requestParamHeaders['service.name'] = $service->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateService', Service::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $response = $registrationServiceClient->getLocation(); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $registrationServiceClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $registrationServiceClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/LookupServiceClient.php b/owl-bot-staging/ServiceDirectory/v1/src/V1/LookupServiceClient.php new file mode 100644 index 00000000000..b1ed13cc79b --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/src/V1/LookupServiceClient.php @@ -0,0 +1,34 @@ + [ + 'google.cloud.servicedirectory.v1.LookupService' => [ + 'ResolveService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ServiceDirectory\V1\ResolveServiceResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'service' => 'projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}', + ], + ], + ], +]; diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/lookup_service_rest_client_config.php b/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/lookup_service_rest_client_config.php new file mode 100644 index 00000000000..d4b279dd3b5 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/lookup_service_rest_client_config.php @@ -0,0 +1,45 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.servicedirectory.v1.LookupService' => [ + 'ResolveService' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/namespaces/*/services/*}:resolve', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_client_config.json b/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_client_config.json new file mode 100644 index 00000000000..2c5cb3b21d3 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_client_config.json @@ -0,0 +1,135 @@ +{ + "interfaces": { + "google.cloud.servicedirectory.v1.RegistrationService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "UNKNOWN" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 15000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 15000, + "total_timeout_millis": 15000 + } + }, + "methods": { + "CreateEndpoint": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateNamespace": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateService": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteEndpoint": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteNamespace": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteService": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetEndpoint": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetNamespace": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetService": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListEndpoints": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListNamespaces": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListServices": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateEndpoint": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateNamespace": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateService": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_descriptor_config.php b/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_descriptor_config.php new file mode 100644 index 00000000000..860ab2d79c1 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_descriptor_config.php @@ -0,0 +1,292 @@ + [ + 'google.cloud.servicedirectory.v1.RegistrationService' => [ + 'CreateEndpoint' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ServiceDirectory\V1\Endpoint', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateNamespace' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ServiceDirectory\V1\PBNamespace', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ServiceDirectory\V1\Service', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteEndpoint' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteNamespace' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetEndpoint' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ServiceDirectory\V1\Endpoint', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetNamespace' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ServiceDirectory\V1\PBNamespace', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ServiceDirectory\V1\Service', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListEndpoints' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEndpoints', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ServiceDirectory\V1\ListEndpointsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListNamespaces' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getNamespaces', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ServiceDirectory\V1\ListNamespacesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListServices' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getServices', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ServiceDirectory\V1\ListServicesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateEndpoint' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ServiceDirectory\V1\Endpoint', + 'headerParams' => [ + [ + 'keyName' => 'endpoint.name', + 'fieldAccessors' => [ + 'getEndpoint', + 'getName', + ], + ], + ], + ], + 'UpdateNamespace' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ServiceDirectory\V1\PBNamespace', + 'headerParams' => [ + [ + 'keyName' => 'namespace.name', + 'fieldAccessors' => [ + 'getNamespace', + 'getName', + ], + ], + ], + ], + 'UpdateService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ServiceDirectory\V1\Service', + 'headerParams' => [ + [ + 'keyName' => 'service.name', + 'fieldAccessors' => [ + 'getService', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'endpoint' => 'projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}', + 'location' => 'projects/{project}/locations/{location}', + 'namespace' => 'projects/{project}/locations/{location}/namespaces/{namespace}', + 'network' => 'projects/{project}/locations/global/networks/{network}', + 'service' => 'projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}', + ], + ], + ], +]; diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_rest_client_config.php b/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_rest_client_config.php new file mode 100644 index 00000000000..9d81e0c9fc0 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_rest_client_config.php @@ -0,0 +1,282 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.servicedirectory.v1.RegistrationService' => [ + 'CreateEndpoint' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints', + 'body' => 'endpoint', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'endpoint_id', + ], + ], + 'CreateNamespace' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/namespaces', + 'body' => 'namespace', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'namespace_id', + ], + ], + 'CreateService' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/namespaces/*}/services', + 'body' => 'service', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'service_id', + ], + ], + 'DeleteEndpoint' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteNamespace' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/namespaces/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteService' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/namespaces/*/services/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetEndpoint' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/namespaces/*}:getIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:getIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetNamespace' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/namespaces/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetService' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/namespaces/*/services/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListEndpoints' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListNamespaces' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/namespaces', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListServices' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/namespaces/*}/services', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/namespaces/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/namespaces/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateEndpoint' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{endpoint.name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}', + 'body' => 'endpoint', + 'placeholders' => [ + 'endpoint.name' => [ + 'getters' => [ + 'getEndpoint', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateNamespace' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{namespace.name=projects/*/locations/*/namespaces/*}', + 'body' => 'namespace', + 'placeholders' => [ + 'namespace.name' => [ + 'getters' => [ + 'getNamespace', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateService' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{service.name=projects/*/locations/*/namespaces/*/services/*}', + 'body' => 'service', + 'placeholders' => [ + 'service.name' => [ + 'getters' => [ + 'getService', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/Client/LookupServiceClientTest.php b/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/Client/LookupServiceClientTest.php new file mode 100644 index 00000000000..1a6ac45c617 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/Client/LookupServiceClientTest.php @@ -0,0 +1,279 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return LookupServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new LookupServiceClient($options); + } + + /** @test */ + public function resolveServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ResolveServiceResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $request = (new ResolveServiceRequest()) + ->setName($formattedName); + $response = $gapicClient->resolveService($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.LookupService/ResolveService', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resolveServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $request = (new ResolveServiceRequest()) + ->setName($formattedName); + try { + $gapicClient->resolveService($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resolveServiceAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ResolveServiceResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $request = (new ResolveServiceRequest()) + ->setName($formattedName); + $response = $gapicClient->resolveServiceAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.LookupService/ResolveService', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/Client/RegistrationServiceClientTest.php b/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/Client/RegistrationServiceClientTest.php new file mode 100644 index 00000000000..638c853ca08 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/Client/RegistrationServiceClientTest.php @@ -0,0 +1,1532 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegistrationServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegistrationServiceClient($options); + } + + /** @test */ + public function createEndpointTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $address = 'address-1147692044'; + $port = 3446913; + $network = 'network1843485230'; + $uid = 'uid115792'; + $expectedResponse = new Endpoint(); + $expectedResponse->setName($name); + $expectedResponse->setAddress($address); + $expectedResponse->setPort($port); + $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $endpointId = 'endpointId-1135808507'; + $endpoint = new Endpoint(); + $request = (new CreateEndpointRequest()) + ->setParent($formattedParent) + ->setEndpointId($endpointId) + ->setEndpoint($endpoint); + $response = $gapicClient->createEndpoint($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/CreateEndpoint', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getEndpointId(); + $this->assertProtobufEquals($endpointId, $actualValue); + $actualValue = $actualRequestObject->getEndpoint(); + $this->assertProtobufEquals($endpoint, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createEndpointExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $endpointId = 'endpointId-1135808507'; + $endpoint = new Endpoint(); + $request = (new CreateEndpointRequest()) + ->setParent($formattedParent) + ->setEndpointId($endpointId) + ->setEndpoint($endpoint); + try { + $gapicClient->createEndpoint($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createNamespaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new PBNamespace(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $namespaceId = 'namespaceId-1253352833'; + $namespace = new PBNamespace(); + $request = (new CreateNamespaceRequest()) + ->setParent($formattedParent) + ->setNamespaceId($namespaceId) + ->setNamespace($namespace); + $response = $gapicClient->createNamespace($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/CreateNamespace', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getNamespaceId(); + $this->assertProtobufEquals($namespaceId, $actualValue); + $actualValue = $actualRequestObject->getNamespace(); + $this->assertProtobufEquals($namespace, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createNamespaceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $namespaceId = 'namespaceId-1253352833'; + $namespace = new PBNamespace(); + $request = (new CreateNamespaceRequest()) + ->setParent($formattedParent) + ->setNamespaceId($namespaceId) + ->setNamespace($namespace); + try { + $gapicClient->createNamespace($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new Service(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $serviceId = 'serviceId-1724763419'; + $service = new Service(); + $request = (new CreateServiceRequest()) + ->setParent($formattedParent) + ->setServiceId($serviceId) + ->setService($service); + $response = $gapicClient->createService($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/CreateService', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getServiceId(); + $this->assertProtobufEquals($serviceId, $actualValue); + $actualValue = $actualRequestObject->getService(); + $this->assertProtobufEquals($service, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $serviceId = 'serviceId-1724763419'; + $service = new Service(); + $request = (new CreateServiceRequest()) + ->setParent($formattedParent) + ->setServiceId($serviceId) + ->setService($service); + try { + $gapicClient->createService($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteEndpointTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); + $request = (new DeleteEndpointRequest()) + ->setName($formattedName); + $gapicClient->deleteEndpoint($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/DeleteEndpoint', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteEndpointExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); + $request = (new DeleteEndpointRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteEndpoint($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteNamespaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $request = (new DeleteNamespaceRequest()) + ->setName($formattedName); + $gapicClient->deleteNamespace($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/DeleteNamespace', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteNamespaceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $request = (new DeleteNamespaceRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteNamespace($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $request = (new DeleteServiceRequest()) + ->setName($formattedName); + $gapicClient->deleteService($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/DeleteService', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $request = (new DeleteServiceRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteService($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEndpointTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $address = 'address-1147692044'; + $port = 3446913; + $network = 'network1843485230'; + $uid = 'uid115792'; + $expectedResponse = new Endpoint(); + $expectedResponse->setName($name2); + $expectedResponse->setAddress($address); + $expectedResponse->setPort($port); + $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); + $request = (new GetEndpointRequest()) + ->setName($formattedName); + $response = $gapicClient->getEndpoint($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/GetEndpoint', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEndpointExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); + $request = (new GetEndpointRequest()) + ->setName($formattedName); + try { + $gapicClient->getEndpoint($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNamespaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $expectedResponse = new PBNamespace(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $request = (new GetNamespaceRequest()) + ->setName($formattedName); + $response = $gapicClient->getNamespace($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/GetNamespace', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNamespaceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $request = (new GetNamespaceRequest()) + ->setName($formattedName); + try { + $gapicClient->getNamespace($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $expectedResponse = new Service(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $request = (new GetServiceRequest()) + ->setName($formattedName); + $response = $gapicClient->getService($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/GetService', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $request = (new GetServiceRequest()) + ->setName($formattedName); + try { + $gapicClient->getService($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEndpointsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $endpointsElement = new Endpoint(); + $endpoints = [ + $endpointsElement, + ]; + $expectedResponse = new ListEndpointsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setEndpoints($endpoints); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $request = (new ListEndpointsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listEndpoints($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getEndpoints()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/ListEndpoints', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEndpointsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $request = (new ListEndpointsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listEndpoints($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNamespacesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $namespacesElement = new PBNamespace(); + $namespaces = [ + $namespacesElement, + ]; + $expectedResponse = new ListNamespacesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setNamespaces($namespaces); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListNamespacesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listNamespaces($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getNamespaces()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/ListNamespaces', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNamespacesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListNamespacesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listNamespaces($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listServicesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $servicesElement = new Service(); + $services = [ + $servicesElement, + ]; + $expectedResponse = new ListServicesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setServices($services); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $request = (new ListServicesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listServices($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/ListServices', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listServicesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $request = (new ListServicesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listServices($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEndpointTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $address = 'address-1147692044'; + $port = 3446913; + $network = 'network1843485230'; + $uid = 'uid115792'; + $expectedResponse = new Endpoint(); + $expectedResponse->setName($name); + $expectedResponse->setAddress($address); + $expectedResponse->setPort($port); + $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $endpoint = new Endpoint(); + $updateMask = new FieldMask(); + $request = (new UpdateEndpointRequest()) + ->setEndpoint($endpoint) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateEndpoint($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/UpdateEndpoint', $actualFuncCall); + $actualValue = $actualRequestObject->getEndpoint(); + $this->assertProtobufEquals($endpoint, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEndpointExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $endpoint = new Endpoint(); + $updateMask = new FieldMask(); + $request = (new UpdateEndpointRequest()) + ->setEndpoint($endpoint) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateEndpoint($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateNamespaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new PBNamespace(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $namespace = new PBNamespace(); + $updateMask = new FieldMask(); + $request = (new UpdateNamespaceRequest()) + ->setNamespace($namespace) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateNamespace($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/UpdateNamespace', $actualFuncCall); + $actualValue = $actualRequestObject->getNamespace(); + $this->assertProtobufEquals($namespace, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateNamespaceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $namespace = new PBNamespace(); + $updateMask = new FieldMask(); + $request = (new UpdateNamespaceRequest()) + ->setNamespace($namespace) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateNamespace($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new Service(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $service = new Service(); + $updateMask = new FieldMask(); + $request = (new UpdateServiceRequest()) + ->setService($service) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateService($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/UpdateService', $actualFuncCall); + $actualValue = $actualRequestObject->getService(); + $this->assertProtobufEquals($service, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $service = new Service(); + $updateMask = new FieldMask(); + $request = (new UpdateServiceRequest()) + ->setService($service) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateService($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createEndpointAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $address = 'address-1147692044'; + $port = 3446913; + $network = 'network1843485230'; + $uid = 'uid115792'; + $expectedResponse = new Endpoint(); + $expectedResponse->setName($name); + $expectedResponse->setAddress($address); + $expectedResponse->setPort($port); + $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $endpointId = 'endpointId-1135808507'; + $endpoint = new Endpoint(); + $request = (new CreateEndpointRequest()) + ->setParent($formattedParent) + ->setEndpointId($endpointId) + ->setEndpoint($endpoint); + $response = $gapicClient->createEndpointAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/CreateEndpoint', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getEndpointId(); + $this->assertProtobufEquals($endpointId, $actualValue); + $actualValue = $actualRequestObject->getEndpoint(); + $this->assertProtobufEquals($endpoint, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/LookupServiceClientTest.php b/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/LookupServiceClientTest.php new file mode 100644 index 00000000000..56def697a8e --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/LookupServiceClientTest.php @@ -0,0 +1,241 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return LookupServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new LookupServiceClient($options); + } + + /** @test */ + public function resolveServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ResolveServiceResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $response = $gapicClient->resolveService($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.LookupService/ResolveService', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resolveServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + try { + $gapicClient->resolveService($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/RegistrationServiceClientTest.php b/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/RegistrationServiceClientTest.php new file mode 100644 index 00000000000..623027b4600 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/RegistrationServiceClientTest.php @@ -0,0 +1,1369 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegistrationServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegistrationServiceClient($options); + } + + /** @test */ + public function createEndpointTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $address = 'address-1147692044'; + $port = 3446913; + $network = 'network1843485230'; + $uid = 'uid115792'; + $expectedResponse = new Endpoint(); + $expectedResponse->setName($name); + $expectedResponse->setAddress($address); + $expectedResponse->setPort($port); + $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $endpointId = 'endpointId-1135808507'; + $endpoint = new Endpoint(); + $response = $gapicClient->createEndpoint($formattedParent, $endpointId, $endpoint); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/CreateEndpoint', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getEndpointId(); + $this->assertProtobufEquals($endpointId, $actualValue); + $actualValue = $actualRequestObject->getEndpoint(); + $this->assertProtobufEquals($endpoint, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createEndpointExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $endpointId = 'endpointId-1135808507'; + $endpoint = new Endpoint(); + try { + $gapicClient->createEndpoint($formattedParent, $endpointId, $endpoint); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createNamespaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new PBNamespace(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $namespaceId = 'namespaceId-1253352833'; + $namespace = new PBNamespace(); + $response = $gapicClient->createNamespace($formattedParent, $namespaceId, $namespace); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/CreateNamespace', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getNamespaceId(); + $this->assertProtobufEquals($namespaceId, $actualValue); + $actualValue = $actualRequestObject->getNamespace(); + $this->assertProtobufEquals($namespace, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createNamespaceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $namespaceId = 'namespaceId-1253352833'; + $namespace = new PBNamespace(); + try { + $gapicClient->createNamespace($formattedParent, $namespaceId, $namespace); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new Service(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $serviceId = 'serviceId-1724763419'; + $service = new Service(); + $response = $gapicClient->createService($formattedParent, $serviceId, $service); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/CreateService', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getServiceId(); + $this->assertProtobufEquals($serviceId, $actualValue); + $actualValue = $actualRequestObject->getService(); + $this->assertProtobufEquals($service, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $serviceId = 'serviceId-1724763419'; + $service = new Service(); + try { + $gapicClient->createService($formattedParent, $serviceId, $service); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteEndpointTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); + $gapicClient->deleteEndpoint($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/DeleteEndpoint', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteEndpointExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); + try { + $gapicClient->deleteEndpoint($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteNamespaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $gapicClient->deleteNamespace($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/DeleteNamespace', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteNamespaceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + try { + $gapicClient->deleteNamespace($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $gapicClient->deleteService($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/DeleteService', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + try { + $gapicClient->deleteService($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEndpointTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $address = 'address-1147692044'; + $port = 3446913; + $network = 'network1843485230'; + $uid = 'uid115792'; + $expectedResponse = new Endpoint(); + $expectedResponse->setName($name2); + $expectedResponse->setAddress($address); + $expectedResponse->setPort($port); + $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); + $response = $gapicClient->getEndpoint($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/GetEndpoint', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEndpointExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); + try { + $gapicClient->getEndpoint($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($resource); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($resource); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNamespaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $expectedResponse = new PBNamespace(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $response = $gapicClient->getNamespace($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/GetNamespace', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNamespaceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + try { + $gapicClient->getNamespace($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $expectedResponse = new Service(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $response = $gapicClient->getService($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/GetService', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + try { + $gapicClient->getService($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEndpointsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $endpointsElement = new Endpoint(); + $endpoints = [ + $endpointsElement, + ]; + $expectedResponse = new ListEndpointsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setEndpoints($endpoints); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $response = $gapicClient->listEndpoints($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getEndpoints()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/ListEndpoints', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEndpointsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + try { + $gapicClient->listEndpoints($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNamespacesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $namespacesElement = new PBNamespace(); + $namespaces = [ + $namespacesElement, + ]; + $expectedResponse = new ListNamespacesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setNamespaces($namespaces); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listNamespaces($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getNamespaces()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/ListNamespaces', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNamespacesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listNamespaces($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listServicesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $servicesElement = new Service(); + $services = [ + $servicesElement, + ]; + $expectedResponse = new ListServicesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setServices($services); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $response = $gapicClient->listServices($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/ListServices', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listServicesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + try { + $gapicClient->listServices($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $gapicClient->setIamPolicy($resource, $policy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + try { + $gapicClient->setIamPolicy($resource, $policy); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $gapicClient->testIamPermissions($resource, $permissions); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + try { + $gapicClient->testIamPermissions($resource, $permissions); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEndpointTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $address = 'address-1147692044'; + $port = 3446913; + $network = 'network1843485230'; + $uid = 'uid115792'; + $expectedResponse = new Endpoint(); + $expectedResponse->setName($name); + $expectedResponse->setAddress($address); + $expectedResponse->setPort($port); + $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $endpoint = new Endpoint(); + $updateMask = new FieldMask(); + $response = $gapicClient->updateEndpoint($endpoint, $updateMask); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/UpdateEndpoint', $actualFuncCall); + $actualValue = $actualRequestObject->getEndpoint(); + $this->assertProtobufEquals($endpoint, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEndpointExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $endpoint = new Endpoint(); + $updateMask = new FieldMask(); + try { + $gapicClient->updateEndpoint($endpoint, $updateMask); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateNamespaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new PBNamespace(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $namespace = new PBNamespace(); + $updateMask = new FieldMask(); + $response = $gapicClient->updateNamespace($namespace, $updateMask); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/UpdateNamespace', $actualFuncCall); + $actualValue = $actualRequestObject->getNamespace(); + $this->assertProtobufEquals($namespace, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateNamespaceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $namespace = new PBNamespace(); + $updateMask = new FieldMask(); + try { + $gapicClient->updateNamespace($namespace, $updateMask); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new Service(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $service = new Service(); + $updateMask = new FieldMask(); + $response = $gapicClient->updateService($service, $updateMask); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/UpdateService', $actualFuncCall); + $actualValue = $actualRequestObject->getService(); + $this->assertProtobufEquals($service, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $service = new Service(); + $updateMask = new FieldMask(); + try { + $gapicClient->updateService($service, $updateMask); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/Endpoint.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/Endpoint.php new file mode 100644 index 00000000000..8194fe79c6f --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/Endpoint.php @@ -0,0 +1,45 @@ +internalAddGeneratedFile( + ' + +4google/cloud/servicedirectory/v1beta1/endpoint.proto%google.cloud.servicedirectory.v1beta1google/api/resource.protogoogle/protobuf/timestamp.proto" +Endpoint +name ( BA +address ( BA +port (BAT +metadata ( 2=.google.cloud.servicedirectory.v1beta1.Endpoint.MetadataEntryBA@ +network ( B/AA) +\'servicedirectory.googleapis.com/Network4 + create_time ( 2.google.protobuf.TimestampBA4 + update_time ( 2.google.protobuf.TimestampBA +uid ( BA/ + MetadataEntry +key (  +value ( :8:A +(servicedirectory.googleapis.com/Endpointfprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}B +)com.google.cloud.servicedirectory.v1beta1B EndpointProtoPZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb%Google.Cloud.ServiceDirectory.V1Beta1%Google\\Cloud\\ServiceDirectory\\V1beta1(Google::Cloud::ServiceDirectory::V1beta1Aa +\'servicedirectory.googleapis.com/Network6projects/{project}/locations/global/networks/{network}bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/LookupService.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/LookupService.php new file mode 100644 index 00000000000..b248278692a --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/LookupService.php @@ -0,0 +1,41 @@ +internalAddGeneratedFile( + ' + +:google/cloud/servicedirectory/v1beta1/lookup_service.proto%google.cloud.servicedirectory.v1beta1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto3google/cloud/servicedirectory/v1beta1/service.proto" +ResolveServiceRequest= +name ( B/AA) +\'servicedirectory.googleapis.com/Service + max_endpoints (BA +endpoint_filter ( BA"Y +ResolveServiceResponse? +service ( 2..google.cloud.servicedirectory.v1beta1.Service2 + LookupService +ResolveService<.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest=.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse"QK"F/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}:resolve:*SAservicedirectory.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB +)com.google.cloud.servicedirectory.v1beta1BLookupServiceProtoPZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb%Google.Cloud.ServiceDirectory.V1Beta1%Google\\Cloud\\ServiceDirectory\\V1beta1(Google::Cloud::ServiceDirectory::V1beta1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/PBNamespace.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/PBNamespace.php new file mode 100644 index 00000000000..d4a4c295b0c --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/PBNamespace.php @@ -0,0 +1,40 @@ +internalAddGeneratedFile( + ' + +5google/cloud/servicedirectory/v1beta1/namespace.proto%google.cloud.servicedirectory.v1beta1google/api/resource.protogoogle/protobuf/timestamp.proto" + Namespace +name ( BAQ +labels ( 2<.google.cloud.servicedirectory.v1beta1.Namespace.LabelsEntryBA4 + create_time ( 2.google.protobuf.TimestampBA4 + update_time ( 2.google.protobuf.TimestampBA +uid ( BA- + LabelsEntry +key (  +value ( :8:nAk +)servicedirectory.googleapis.com/Namespace>projects/{project}/locations/{location}/namespaces/{namespace}B +)com.google.cloud.servicedirectory.v1beta1BNamespaceProtoPZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb%Google.Cloud.ServiceDirectory.V1Beta1%Google\\Cloud\\ServiceDirectory\\V1beta1(Google::Cloud::ServiceDirectory::V1beta1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/RegistrationService.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/RegistrationService.php new file mode 100644 index 00000000000..3428c4a76f4 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/RegistrationService.php @@ -0,0 +1,135 @@ +internalAddGeneratedFile( + ' +; +@google/cloud/servicedirectory/v1beta1/registration_service.proto%google.cloud.servicedirectory.v1beta1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto4google/cloud/servicedirectory/v1beta1/endpoint.proto5google/cloud/servicedirectory/v1beta1/namespace.proto3google/cloud/servicedirectory/v1beta1/service.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto" +CreateNamespaceRequest9 +parent ( B)AA# +!locations.googleapis.com/Location + namespace_id ( BAH + namespace ( 20.google.cloud.servicedirectory.v1beta1.NamespaceBA" +ListNamespacesRequest9 +parent ( B)AA# +!locations.googleapis.com/Location + page_size (BA + +page_token ( BA +filter ( BA +order_by ( BA"w +ListNamespacesResponseD + +namespaces ( 20.google.cloud.servicedirectory.v1beta1.Namespace +next_page_token ( "V +GetNamespaceRequest? +name ( B1AA+ +)servicedirectory.googleapis.com/Namespace" +UpdateNamespaceRequestH + namespace ( 20.google.cloud.servicedirectory.v1beta1.NamespaceBA4 + update_mask ( 2.google.protobuf.FieldMaskBA"Y +DeleteNamespaceRequest? +name ( B1AA+ +)servicedirectory.googleapis.com/Namespace" +CreateServiceRequestA +parent ( B1AA+ +)servicedirectory.googleapis.com/Namespace + +service_id ( BAD +service ( 2..google.cloud.servicedirectory.v1beta1.ServiceBA" +ListServicesRequestA +parent ( B1AA+ +)servicedirectory.googleapis.com/Namespace + page_size (BA + +page_token ( BA +filter ( BA +order_by ( BA"q +ListServicesResponse@ +services ( 2..google.cloud.servicedirectory.v1beta1.Service +next_page_token ( "R +GetServiceRequest= +name ( B/AA) +\'servicedirectory.googleapis.com/Service" +UpdateServiceRequestD +service ( 2..google.cloud.servicedirectory.v1beta1.ServiceBA4 + update_mask ( 2.google.protobuf.FieldMaskBA"U +DeleteServiceRequest= +name ( B/AA) +\'servicedirectory.googleapis.com/Service" +CreateEndpointRequest? +parent ( B/AA) +\'servicedirectory.googleapis.com/Service + endpoint_id ( BAF +endpoint ( 2/.google.cloud.servicedirectory.v1beta1.EndpointBA" +ListEndpointsRequest? +parent ( B/AA) +\'servicedirectory.googleapis.com/Service + page_size (BA + +page_token ( BA +filter ( BA +order_by ( BA"t +ListEndpointsResponseB + endpoints ( 2/.google.cloud.servicedirectory.v1beta1.Endpoint +next_page_token ( "T +GetEndpointRequest> +name ( B0AA* +(servicedirectory.googleapis.com/Endpoint" +UpdateEndpointRequestF +endpoint ( 2/.google.cloud.servicedirectory.v1beta1.EndpointBA4 + update_mask ( 2.google.protobuf.FieldMaskBA"W +DeleteEndpointRequest> +name ( B0AA* +(servicedirectory.googleapis.com/Endpoint2" +RegistrationService +CreateNamespace=.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest0.google.cloud.servicedirectory.v1beta1.Namespace"f@"3/v1beta1/{parent=projects/*/locations/*}/namespaces: namespaceAparent,namespace,namespace_id +ListNamespaces<.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest=.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse"D53/v1beta1/{parent=projects/*/locations/*}/namespacesAparent + GetNamespace:.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest0.google.cloud.servicedirectory.v1beta1.Namespace"B53/v1beta1/{name=projects/*/locations/*/namespaces/*}Aname +UpdateNamespace=.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest0.google.cloud.servicedirectory.v1beta1.Namespace"hJ2=/v1beta1/{namespace.name=projects/*/locations/*/namespaces/*}: namespaceAnamespace,update_mask +DeleteNamespace=.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest.google.protobuf.Empty"B5*3/v1beta1/{name=projects/*/locations/*/namespaces/*}Aname + CreateService;.google.cloud.servicedirectory.v1beta1.CreateServiceRequest..google.cloud.servicedirectory.v1beta1.Service"kI">/v1beta1/{parent=projects/*/locations/*/namespaces/*}/services:serviceAparent,service,service_id + ListServices:.google.cloud.servicedirectory.v1beta1.ListServicesRequest;.google.cloud.servicedirectory.v1beta1.ListServicesResponse"O@>/v1beta1/{parent=projects/*/locations/*/namespaces/*}/servicesAparent + +GetService8.google.cloud.servicedirectory.v1beta1.GetServiceRequest..google.cloud.servicedirectory.v1beta1.Service"M@>/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}Aname + UpdateService;.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest..google.cloud.servicedirectory.v1beta1.Service"mQ2F/v1beta1/{service.name=projects/*/locations/*/namespaces/*/services/*}:serviceAservice,update_mask + DeleteService;.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest.google.protobuf.Empty"M@*>/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}Aname +CreateEndpoint<.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest/.google.cloud.servicedirectory.v1beta1.Endpoint"zV"J/v1beta1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints:endpointAparent,endpoint,endpoint_id + ListEndpoints;.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest<.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse"[LJ/v1beta1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpointsAparent + GetEndpoint9.google.cloud.servicedirectory.v1beta1.GetEndpointRequest/.google.cloud.servicedirectory.v1beta1.Endpoint"YLJ/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}Aname +UpdateEndpoint<.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest/.google.cloud.servicedirectory.v1beta1.Endpoint"|_2S/v1beta1/{endpoint.name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}:endpointAendpoint,update_mask +DeleteEndpoint<.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest.google.protobuf.Empty"YL*J/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}Aname + GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy""D/v1beta1/{resource=projects/*/locations/*/namespaces/*}:getIamPolicy:*ZT"O/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:getIamPolicy:*ZU"P/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:getIamPolicy:* + SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy""D/v1beta1/{resource=projects/*/locations/*/namespaces/*}:setIamPolicy:*ZT"O/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:setIamPolicy:*ZU"P/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:setIamPolicy:* +TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse""J/v1beta1/{resource=projects/*/locations/*/namespaces/*}:testIamPermissions:*ZZ"U/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions:*Z["V/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:testIamPermissions:*SAservicedirectory.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB +)com.google.cloud.servicedirectory.v1beta1BRegistrationServiceProtoPZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb%Google.Cloud.ServiceDirectory.V1Beta1%Google\\Cloud\\ServiceDirectory\\V1beta1(Google::Cloud::ServiceDirectory::V1beta1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/Service.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/Service.php new file mode 100644 index 00000000000..48ecd3cb74e --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/Service.php @@ -0,0 +1,42 @@ +internalAddGeneratedFile( + ' + +3google/cloud/servicedirectory/v1beta1/service.proto%google.cloud.servicedirectory.v1beta1google/api/resource.proto4google/cloud/servicedirectory/v1beta1/endpoint.protogoogle/protobuf/timestamp.proto" +Service +name ( BAS +metadata ( 2<.google.cloud.servicedirectory.v1beta1.Service.MetadataEntryBAG + endpoints ( 2/.google.cloud.servicedirectory.v1beta1.EndpointBA4 + create_time ( 2.google.protobuf.TimestampBA4 + update_time ( 2.google.protobuf.TimestampBA +uid ( BA/ + MetadataEntry +key (  +value ( :8:A| +\'servicedirectory.googleapis.com/ServiceQprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}B +)com.google.cloud.servicedirectory.v1beta1B ServiceProtoPZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb%Google.Cloud.ServiceDirectory.V1Beta1%Google\\Cloud\\ServiceDirectory\\V1beta1(Google::Cloud::ServiceDirectory::V1beta1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateEndpointRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateEndpointRequest.php new file mode 100644 index 00000000000..6b351f46162 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateEndpointRequest.php @@ -0,0 +1,170 @@ +google.cloud.servicedirectory.v1beta1.CreateEndpointRequest + */ +class CreateEndpointRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the service that this endpoint provides. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $endpoint_id = ''; + /** + * Required. A endpoint with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $endpoint = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the service that this endpoint provides. + * @type string $endpoint_id + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * @type \Google\Cloud\ServiceDirectory\V1beta1\Endpoint $endpoint + * Required. A endpoint with initial fields set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the service that this endpoint provides. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the service that this endpoint provides. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEndpointId() + { + return $this->endpoint_id; + } + + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEndpointId($var) + { + GPBUtil::checkString($var, True); + $this->endpoint_id = $var; + + return $this; + } + + /** + * Required. A endpoint with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ServiceDirectory\V1beta1\Endpoint|null + */ + public function getEndpoint() + { + return $this->endpoint; + } + + public function hasEndpoint() + { + return isset($this->endpoint); + } + + public function clearEndpoint() + { + unset($this->endpoint); + } + + /** + * Required. A endpoint with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ServiceDirectory\V1beta1\Endpoint $var + * @return $this + */ + public function setEndpoint($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1beta1\Endpoint::class); + $this->endpoint = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateNamespaceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateNamespaceRequest.php new file mode 100644 index 00000000000..f44299101dc --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateNamespaceRequest.php @@ -0,0 +1,174 @@ +google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest + */ +class CreateNamespaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the project and location the namespace + * will be created in. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $namespace_id = ''; + /** + * Required. A namespace with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $namespace = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the project and location the namespace + * will be created in. + * @type string $namespace_id + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * @type \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace $namespace + * Required. A namespace with initial fields set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the project and location the namespace + * will be created in. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the project and location the namespace + * will be created in. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNamespaceId() + { + return $this->namespace_id; + } + + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNamespaceId($var) + { + GPBUtil::checkString($var, True); + $this->namespace_id = $var; + + return $this; + } + + /** + * Required. A namespace with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace|null + */ + public function getNamespace() + { + return $this->namespace; + } + + public function hasNamespace() + { + return isset($this->namespace); + } + + public function clearNamespace() + { + unset($this->namespace); + } + + /** + * Required. A namespace with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace $var + * @return $this + */ + public function setNamespace($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace::class); + $this->namespace = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateServiceRequest.php new file mode 100644 index 00000000000..30b20506c7e --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateServiceRequest.php @@ -0,0 +1,170 @@ +google.cloud.servicedirectory.v1beta1.CreateServiceRequest + */ +class CreateServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the namespace this service will belong to. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service_id = ''; + /** + * Required. A service with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the namespace this service will belong to. + * @type string $service_id + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * @type \Google\Cloud\ServiceDirectory\V1beta1\Service $service + * Required. A service with initial fields set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the namespace this service will belong to. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the namespace this service will belong to. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getServiceId() + { + return $this->service_id; + } + + /** + * Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * + * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setServiceId($var) + { + GPBUtil::checkString($var, True); + $this->service_id = $var; + + return $this; + } + + /** + * Required. A service with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ServiceDirectory\V1beta1\Service|null + */ + public function getService() + { + return $this->service; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Required. A service with initial fields set. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ServiceDirectory\V1beta1\Service $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1beta1\Service::class); + $this->service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteEndpointRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteEndpointRequest.php new file mode 100644 index 00000000000..3f41216681a --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteEndpointRequest.php @@ -0,0 +1,68 @@ +google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest + */ +class DeleteEndpointRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the endpoint to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the endpoint to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the endpoint to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the endpoint to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteNamespaceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteNamespaceRequest.php new file mode 100644 index 00000000000..02f9aed934a --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteNamespaceRequest.php @@ -0,0 +1,68 @@ +google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest + */ +class DeleteNamespaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the namespace to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the namespace to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the namespace to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the namespace to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteServiceRequest.php new file mode 100644 index 00000000000..1d04c1b981b --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteServiceRequest.php @@ -0,0 +1,68 @@ +google.cloud.servicedirectory.v1beta1.DeleteServiceRequest + */ +class DeleteServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the service to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the service to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the service to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the service to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/Endpoint.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/Endpoint.php new file mode 100644 index 00000000000..e1677cb9a97 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/Endpoint.php @@ -0,0 +1,447 @@ +google.cloud.servicedirectory.v1beta1.Endpoint + */ +class Endpoint extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The resource name for the endpoint in the format + * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + * like: + * * `8.8.8` + * * `8.8.8.8:53` + * * `test:bad:address` + * * `[::1]` + * * `[::1]:8080` + * Limited to 45 characters. + * + * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $address = ''; + /** + * Optional. Service Directory rejects values outside of `[0, 65535]`. + * + * Generated from protobuf field int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $port = 0; + /** + * Optional. Metadata for the endpoint. This data can be consumed by service + * clients. + * Restrictions: + * * The entire metadata dictionary may contain up to 512 characters, + * spread accoss all key-value pairs. Metadata that goes beyond this + * limit are rejected + * * Valid metadata keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/). + * Metadata that fails to meet these requirements are rejected + * Note: This field is equivalent to the `annotations` field in the v1 API. + * They have the same syntax and read/write to the same location in Service + * Directory. + * + * Generated from protobuf field map metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $metadata; + /** + * Immutable. The Google Compute Engine network (VPC) of the endpoint in the + * format `projects//locations/global/networks/*`. + * The project must be specified by project number (project id is rejected). + * Incorrectly formatted networks are rejected, but no other validation + * is performed on this field (ex. network or project existence, reachability, + * or permissions). + * + * Generated from protobuf field string network = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $network = ''; + /** + * Output only. The timestamp when the endpoint was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp when the endpoint was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * endpoint. + * + * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. The resource name for the endpoint in the format + * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + * @type string $address + * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + * like: + * * `8.8.8` + * * `8.8.8.8:53` + * * `test:bad:address` + * * `[::1]` + * * `[::1]:8080` + * Limited to 45 characters. + * @type int $port + * Optional. Service Directory rejects values outside of `[0, 65535]`. + * @type array|\Google\Protobuf\Internal\MapField $metadata + * Optional. Metadata for the endpoint. This data can be consumed by service + * clients. + * Restrictions: + * * The entire metadata dictionary may contain up to 512 characters, + * spread accoss all key-value pairs. Metadata that goes beyond this + * limit are rejected + * * Valid metadata keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/). + * Metadata that fails to meet these requirements are rejected + * Note: This field is equivalent to the `annotations` field in the v1 API. + * They have the same syntax and read/write to the same location in Service + * Directory. + * @type string $network + * Immutable. The Google Compute Engine network (VPC) of the endpoint in the + * format `projects//locations/global/networks/*`. + * The project must be specified by project number (project id is rejected). + * Incorrectly formatted networks are rejected, but no other validation + * is performed on this field (ex. network or project existence, reachability, + * or permissions). + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp when the endpoint was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp when the endpoint was last updated. + * @type string $uid + * Output only. A globally unique identifier (in UUID4 format) for this + * endpoint. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\Endpoint::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The resource name for the endpoint in the format + * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. The resource name for the endpoint in the format + * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + * like: + * * `8.8.8` + * * `8.8.8.8:53` + * * `test:bad:address` + * * `[::1]` + * * `[::1]:8080` + * Limited to 45 characters. + * + * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + * like: + * * `8.8.8` + * * `8.8.8.8:53` + * * `test:bad:address` + * * `[::1]` + * * `[::1]:8080` + * Limited to 45 characters. + * + * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $var; + + return $this; + } + + /** + * Optional. Service Directory rejects values outside of `[0, 65535]`. + * + * Generated from protobuf field int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPort() + { + return $this->port; + } + + /** + * Optional. Service Directory rejects values outside of `[0, 65535]`. + * + * Generated from protobuf field int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + + /** + * Optional. Metadata for the endpoint. This data can be consumed by service + * clients. + * Restrictions: + * * The entire metadata dictionary may contain up to 512 characters, + * spread accoss all key-value pairs. Metadata that goes beyond this + * limit are rejected + * * Valid metadata keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/). + * Metadata that fails to meet these requirements are rejected + * Note: This field is equivalent to the `annotations` field in the v1 API. + * They have the same syntax and read/write to the same location in Service + * Directory. + * + * Generated from protobuf field map metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Optional. Metadata for the endpoint. This data can be consumed by service + * clients. + * Restrictions: + * * The entire metadata dictionary may contain up to 512 characters, + * spread accoss all key-value pairs. Metadata that goes beyond this + * limit are rejected + * * Valid metadata keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/). + * Metadata that fails to meet these requirements are rejected + * Note: This field is equivalent to the `annotations` field in the v1 API. + * They have the same syntax and read/write to the same location in Service + * Directory. + * + * Generated from protobuf field map metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + + /** + * Immutable. The Google Compute Engine network (VPC) of the endpoint in the + * format `projects//locations/global/networks/*`. + * The project must be specified by project number (project id is rejected). + * Incorrectly formatted networks are rejected, but no other validation + * is performed on this field (ex. network or project existence, reachability, + * or permissions). + * + * Generated from protobuf field string network = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Immutable. The Google Compute Engine network (VPC) of the endpoint in the + * format `projects//locations/global/networks/*`. + * The project must be specified by project number (project id is rejected). + * Incorrectly formatted networks are rejected, but no other validation + * is performed on this field (ex. network or project existence, reachability, + * or permissions). + * + * Generated from protobuf field string network = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Output only. The timestamp when the endpoint was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp when the endpoint was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp when the endpoint was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The timestamp when the endpoint was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * endpoint. + * + * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * endpoint. + * + * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetEndpointRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetEndpointRequest.php new file mode 100644 index 00000000000..c4f895506d8 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetEndpointRequest.php @@ -0,0 +1,70 @@ +google.cloud.servicedirectory.v1beta1.GetEndpointRequest + */ +class GetEndpointRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the endpoint to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the endpoint to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the endpoint to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the endpoint to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetNamespaceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetNamespaceRequest.php new file mode 100644 index 00000000000..da3fb275998 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetNamespaceRequest.php @@ -0,0 +1,68 @@ +google.cloud.servicedirectory.v1beta1.GetNamespaceRequest + */ +class GetNamespaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the namespace to retrieve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the namespace to retrieve. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the namespace to retrieve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the namespace to retrieve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetServiceRequest.php new file mode 100644 index 00000000000..5b792713890 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetServiceRequest.php @@ -0,0 +1,70 @@ +google.cloud.servicedirectory.v1beta1.GetServiceRequest + */ +class GetServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the service to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the service to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the service to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the service to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListEndpointsRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListEndpointsRequest.php new file mode 100644 index 00000000000..656799a97ce --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListEndpointsRequest.php @@ -0,0 +1,352 @@ +google.cloud.servicedirectory.v1beta1.ListEndpointsRequest + */ +class ListEndpointsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the service whose endpoints you'd like to + * list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, `metadata.` for map + * field, or `attributes.` for attributes field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `metadata.owner` returns endpoints that have a metadata with the key + * `owner`, this is the same as `metadata:owner` + * * `metadata.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have + * `owner` in metadata key but value is not `sd` AND have key/value + * `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoints, it returns no results + * * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ + * IP` returns endpoints with the corresponding kubernetes_resource_type + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows values: `name`, `address`, `port` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the service whose endpoints you'd like to + * list. + * @type int $page_size + * Optional. The maximum number of items to return. + * @type string $page_token + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @type string $filter + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, `metadata.` for map + * field, or `attributes.` for attributes field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `metadata.owner` returns endpoints that have a metadata with the key + * `owner`, this is the same as `metadata:owner` + * * `metadata.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have + * `owner` in metadata key but value is not `sd` AND have key/value + * `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoints, it returns no results + * * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ + * IP` returns endpoints with the corresponding kubernetes_resource_type + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type string $order_by + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows values: `name`, `address`, `port` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the service whose endpoints you'd like to + * list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the service whose endpoints you'd like to + * list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, `metadata.` for map + * field, or `attributes.` for attributes field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `metadata.owner` returns endpoints that have a metadata with the key + * `owner`, this is the same as `metadata:owner` + * * `metadata.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have + * `owner` in metadata key but value is not `sd` AND have key/value + * `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoints, it returns no results + * * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ + * IP` returns endpoints with the corresponding kubernetes_resource_type + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, `metadata.` for map + * field, or `attributes.` for attributes field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `metadata.owner` returns endpoints that have a metadata with the key + * `owner`, this is the same as `metadata:owner` + * * `metadata.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have + * `owner` in metadata key but value is not `sd` AND have key/value + * `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoints, it returns no results + * * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ + * IP` returns endpoints with the corresponding kubernetes_resource_type + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows values: `name`, `address`, `port` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows values: `name`, `address`, `port` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListEndpointsResponse.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListEndpointsResponse.php new file mode 100644 index 00000000000..11e79ca2bd7 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListEndpointsResponse.php @@ -0,0 +1,106 @@ +google.cloud.servicedirectory.v1beta1.ListEndpointsResponse + */ +class ListEndpointsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of endpoints. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + private $endpoints; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ServiceDirectory\V1beta1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $endpoints + * The list of endpoints. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * The list of endpoints. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEndpoints() + { + return $this->endpoints; + } + + /** + * The list of endpoints. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + * @param array<\Google\Cloud\ServiceDirectory\V1beta1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEndpoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceDirectory\V1beta1\Endpoint::class); + $this->endpoints = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListNamespacesRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListNamespacesRequest.php new file mode 100644 index 00000000000..97662ebdf6d --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListNamespacesRequest.php @@ -0,0 +1,332 @@ +google.cloud.servicedirectory.v1beta1.ListNamespacesRequest + */ +class ListNamespacesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the project and location whose namespaces + * you'd like to list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `labels.` for map field, or + * `attributes.` for attributes field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `labels.owner` returns namespaces that have a label with the key + * `owner`, this is the same as `labels:owner` + * * `labels.owner=sd` returns namespaces that have key/value `owner=sd` + * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + * returns namespaces that have name that is alphabetically later than the + * string, so "namespace-e" is returned but "namespace-a" is not + * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + * `owner` in label key but value is not `sd` AND have key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that namespace + * doesn't have a field called "doesnotexist". Since the filter does not + * match any namespaces, it returns no results + * * `attributes.managed_registration=true` returns namespaces that are + * managed by a GCP product or service + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the project and location whose namespaces + * you'd like to list. + * @type int $page_size + * Optional. The maximum number of items to return. + * @type string $page_token + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @type string $filter + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `labels.` for map field, or + * `attributes.` for attributes field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `labels.owner` returns namespaces that have a label with the key + * `owner`, this is the same as `labels:owner` + * * `labels.owner=sd` returns namespaces that have key/value `owner=sd` + * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + * returns namespaces that have name that is alphabetically later than the + * string, so "namespace-e" is returned but "namespace-a" is not + * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + * `owner` in label key but value is not `sd` AND have key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that namespace + * doesn't have a field called "doesnotexist". Since the filter does not + * match any namespaces, it returns no results + * * `attributes.managed_registration=true` returns namespaces that are + * managed by a GCP product or service + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type string $order_by + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the project and location whose namespaces + * you'd like to list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the project and location whose namespaces + * you'd like to list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `labels.` for map field, or + * `attributes.` for attributes field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `labels.owner` returns namespaces that have a label with the key + * `owner`, this is the same as `labels:owner` + * * `labels.owner=sd` returns namespaces that have key/value `owner=sd` + * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + * returns namespaces that have name that is alphabetically later than the + * string, so "namespace-e" is returned but "namespace-a" is not + * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + * `owner` in label key but value is not `sd` AND have key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that namespace + * doesn't have a field called "doesnotexist". Since the filter does not + * match any namespaces, it returns no results + * * `attributes.managed_registration=true` returns namespaces that are + * managed by a GCP product or service + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `labels.` for map field, or + * `attributes.` for attributes field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `labels.owner` returns namespaces that have a label with the key + * `owner`, this is the same as `labels:owner` + * * `labels.owner=sd` returns namespaces that have key/value `owner=sd` + * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + * returns namespaces that have name that is alphabetically later than the + * string, so "namespace-e" is returned but "namespace-a" is not + * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + * `owner` in label key but value is not `sd` AND have key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that namespace + * doesn't have a field called "doesnotexist". Since the filter does not + * match any namespaces, it returns no results + * * `attributes.managed_registration=true` returns namespaces that are + * managed by a GCP product or service + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListNamespacesResponse.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListNamespacesResponse.php new file mode 100644 index 00000000000..7490e2159ae --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListNamespacesResponse.php @@ -0,0 +1,106 @@ +google.cloud.servicedirectory.v1beta1.ListNamespacesResponse + */ +class ListNamespacesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of namespaces. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + private $namespaces; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ServiceDirectory\V1beta1\PBNamespace>|\Google\Protobuf\Internal\RepeatedField $namespaces + * The list of namespaces. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * The list of namespaces. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNamespaces() + { + return $this->namespaces; + } + + /** + * The list of namespaces. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + * @param array<\Google\Cloud\ServiceDirectory\V1beta1\PBNamespace>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNamespaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace::class); + $this->namespaces = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListServicesRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListServicesRequest.php new file mode 100644 index 00000000000..3529638bf7a --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListServicesRequest.php @@ -0,0 +1,344 @@ +google.cloud.servicedirectory.v1beta1.ListServicesRequest + */ +class ListServicesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the namespace whose services you'd + * like to list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `metadata.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `metadata.owner` returns services that have a metadata with the key + * `owner`, this is the same as `metadata:owner` + * * `metadata.protocol=gRPC` returns services that have key/value + * `protocol=gRPC` + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + * returns services that have name that is alphabetically later than the + * string, so "service-e" is returned but "service-a" is not + * * `metadata.owner!=sd AND metadata.foo=bar` returns services that have + * `owner` in metadata key but value is not `sd` AND have key/value + * `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that service + * doesn't have a field called "doesnotexist". Since the filter does not + * match any services, it returns no results + * * `attributes.managed_registration=true` returns services that are + * managed + * by a GCP product or service + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the namespace whose services you'd + * like to list. + * @type int $page_size + * Optional. The maximum number of items to return. + * @type string $page_token + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @type string $filter + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `metadata.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `metadata.owner` returns services that have a metadata with the key + * `owner`, this is the same as `metadata:owner` + * * `metadata.protocol=gRPC` returns services that have key/value + * `protocol=gRPC` + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + * returns services that have name that is alphabetically later than the + * string, so "service-e" is returned but "service-a" is not + * * `metadata.owner!=sd AND metadata.foo=bar` returns services that have + * `owner` in metadata key but value is not `sd` AND have key/value + * `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that service + * doesn't have a field called "doesnotexist". Since the filter does not + * match any services, it returns no results + * * `attributes.managed_registration=true` returns services that are + * managed + * by a GCP product or service + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type string $order_by + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the namespace whose services you'd + * like to list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the namespace whose services you'd + * like to list. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `metadata.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `metadata.owner` returns services that have a metadata with the key + * `owner`, this is the same as `metadata:owner` + * * `metadata.protocol=gRPC` returns services that have key/value + * `protocol=gRPC` + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + * returns services that have name that is alphabetically later than the + * string, so "service-e" is returned but "service-a" is not + * * `metadata.owner!=sd AND metadata.foo=bar` returns services that have + * `owner` in metadata key but value is not `sd` AND have key/value + * `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that service + * doesn't have a field called "doesnotexist". Since the filter does not + * match any services, it returns no results + * * `attributes.managed_registration=true` returns services that are + * managed + * by a GCP product or service + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `metadata.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `metadata.owner` returns services that have a metadata with the key + * `owner`, this is the same as `metadata:owner` + * * `metadata.protocol=gRPC` returns services that have key/value + * `protocol=gRPC` + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + * returns services that have name that is alphabetically later than the + * string, so "service-e" is returned but "service-a" is not + * * `metadata.owner!=sd AND metadata.foo=bar` returns services that have + * `owner` in metadata key but value is not `sd` AND have key/value + * `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that service + * doesn't have a field called "doesnotexist". Since the filter does not + * match any services, it returns no results + * * `attributes.managed_registration=true` returns services that are + * managed + * by a GCP product or service + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListServicesResponse.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListServicesResponse.php new file mode 100644 index 00000000000..cbc3360635b --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListServicesResponse.php @@ -0,0 +1,106 @@ +google.cloud.servicedirectory.v1beta1.ListServicesResponse + */ +class ListServicesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of services. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + private $services; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ServiceDirectory\V1beta1\Service>|\Google\Protobuf\Internal\RepeatedField $services + * The list of services. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * The list of services. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServices() + { + return $this->services; + } + + /** + * The list of services. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + * @param array<\Google\Cloud\ServiceDirectory\V1beta1\Service>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceDirectory\V1beta1\Service::class); + $this->services = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/PBNamespace.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/PBNamespace.php new file mode 100644 index 00000000000..c12060ce211 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/PBNamespace.php @@ -0,0 +1,241 @@ +google.cloud.servicedirectory.v1beta1.Namespace + */ +class PBNamespace extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The resource name for the namespace in the format + * `projects/*/locations/*/namespaces/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Optional. Resource labels associated with this namespace. + * No more than 64 user labels can be associated with a given resource. Label + * keys and values can be no longer than 63 characters. + * + * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. The timestamp when the namespace was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp when the namespace was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * namespace. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. The resource name for the namespace in the format + * `projects/*/locations/*/namespaces/*`. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Resource labels associated with this namespace. + * No more than 64 user labels can be associated with a given resource. Label + * keys and values can be no longer than 63 characters. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp when the namespace was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp when the namespace was last updated. + * @type string $uid + * Output only. A globally unique identifier (in UUID4 format) for this + * namespace. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\PBNamespace::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The resource name for the namespace in the format + * `projects/*/locations/*/namespaces/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. The resource name for the namespace in the format + * `projects/*/locations/*/namespaces/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Resource labels associated with this namespace. + * No more than 64 user labels can be associated with a given resource. Label + * keys and values can be no longer than 63 characters. + * + * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Resource labels associated with this namespace. + * No more than 64 user labels can be associated with a given resource. Label + * keys and values can be no longer than 63 characters. + * + * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. The timestamp when the namespace was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp when the namespace was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp when the namespace was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The timestamp when the namespace was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * namespace. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * namespace. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ResolveServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ResolveServiceRequest.php new file mode 100644 index 00000000000..2c3b93bcf5e --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ResolveServiceRequest.php @@ -0,0 +1,265 @@ +google.cloud.servicedirectory.v1beta1.ResolveServiceRequest + */ +class ResolveServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the service to resolve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The maximum number of endpoints to return. Defaults to 25. + * Maximum is 100. If a value less than one is specified, the Default is used. + * If a value greater than the Maximum is specified, the Maximum is used. + * + * Generated from protobuf field int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_endpoints = 0; + /** + * Optional. The filter applied to the endpoints of the resolved service. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `metadata.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `metadata.owner` returns endpoints that have a annotation with the key + * `owner`, this is the same as `metadata:owner` + * * `metadata.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` + * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have + * `owner` in annotation key but value is not `sd` AND have key/value + * `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoint, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $endpoint_filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the service to resolve. + * @type int $max_endpoints + * Optional. The maximum number of endpoints to return. Defaults to 25. + * Maximum is 100. If a value less than one is specified, the Default is used. + * If a value greater than the Maximum is specified, the Maximum is used. + * @type string $endpoint_filter + * Optional. The filter applied to the endpoints of the resolved service. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `metadata.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `metadata.owner` returns endpoints that have a annotation with the key + * `owner`, this is the same as `metadata:owner` + * * `metadata.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` + * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have + * `owner` in annotation key but value is not `sd` AND have key/value + * `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoint, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\LookupService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the service to resolve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the service to resolve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The maximum number of endpoints to return. Defaults to 25. + * Maximum is 100. If a value less than one is specified, the Default is used. + * If a value greater than the Maximum is specified, the Maximum is used. + * + * Generated from protobuf field int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMaxEndpoints() + { + return $this->max_endpoints; + } + + /** + * Optional. The maximum number of endpoints to return. Defaults to 25. + * Maximum is 100. If a value less than one is specified, the Default is used. + * If a value greater than the Maximum is specified, the Maximum is used. + * + * Generated from protobuf field int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMaxEndpoints($var) + { + GPBUtil::checkInt32($var); + $this->max_endpoints = $var; + + return $this; + } + + /** + * Optional. The filter applied to the endpoints of the resolved service. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `metadata.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `metadata.owner` returns endpoints that have a annotation with the key + * `owner`, this is the same as `metadata:owner` + * * `metadata.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` + * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have + * `owner` in annotation key but value is not `sd` AND have key/value + * `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoint, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEndpointFilter() + { + return $this->endpoint_filter; + } + + /** + * Optional. The filter applied to the endpoints of the resolved service. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `metadata.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * Examples of valid filters: + * * `metadata.owner` returns endpoints that have a annotation with the key + * `owner`, this is the same as `metadata:owner` + * * `metadata.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` + * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have + * `owner` in annotation key but value is not `sd` AND have key/value + * `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoint, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEndpointFilter($var) + { + GPBUtil::checkString($var, True); + $this->endpoint_filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ResolveServiceResponse.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ResolveServiceResponse.php new file mode 100644 index 00000000000..b8f91d803a1 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ResolveServiceResponse.php @@ -0,0 +1,71 @@ +google.cloud.servicedirectory.v1beta1.ResolveServiceResponse + */ +class ResolveServiceResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 1; + */ + protected $service = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ServiceDirectory\V1beta1\Service $service + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\LookupService::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 1; + * @return \Google\Cloud\ServiceDirectory\V1beta1\Service|null + */ + public function getService() + { + return $this->service; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 1; + * @param \Google\Cloud\ServiceDirectory\V1beta1\Service $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1beta1\Service::class); + $this->service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/Service.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/Service.php new file mode 100644 index 00000000000..4f3b8f90a6f --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/Service.php @@ -0,0 +1,352 @@ +google.cloud.servicedirectory.v1beta1.Service + */ +class Service extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The resource name for the service in the format + * `projects/*/locations/*/namespaces/*/services/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Optional. Metadata for the service. This data can be consumed by service + * clients. + * Restrictions: + * * The entire metadata dictionary may contain up to 2000 characters, + * spread accoss all key-value pairs. Metadata that goes beyond this + * limit are rejected + * * Valid metadata keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/). + * Metadata that fails to meet these requirements are rejected + * Note: This field is equivalent to the `annotations` field in the v1 API. + * They have the same syntax and read/write to the same location in Service + * Directory. + * + * Generated from protobuf field map metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $metadata; + /** + * Output only. Endpoints associated with this service. Returned on + * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. + * Control plane clients should use + * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $endpoints; + /** + * Output only. The timestamp when the service was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp when the service was last updated. Note: + * endpoints being created/deleted/updated within the service are not + * considered service updates for the purpose of this timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * service. + * + * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. The resource name for the service in the format + * `projects/*/locations/*/namespaces/*/services/*`. + * @type array|\Google\Protobuf\Internal\MapField $metadata + * Optional. Metadata for the service. This data can be consumed by service + * clients. + * Restrictions: + * * The entire metadata dictionary may contain up to 2000 characters, + * spread accoss all key-value pairs. Metadata that goes beyond this + * limit are rejected + * * Valid metadata keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/). + * Metadata that fails to meet these requirements are rejected + * Note: This field is equivalent to the `annotations` field in the v1 API. + * They have the same syntax and read/write to the same location in Service + * Directory. + * @type array<\Google\Cloud\ServiceDirectory\V1beta1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $endpoints + * Output only. Endpoints associated with this service. Returned on + * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. + * Control plane clients should use + * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp when the service was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp when the service was last updated. Note: + * endpoints being created/deleted/updated within the service are not + * considered service updates for the purpose of this timestamp. + * @type string $uid + * Output only. A globally unique identifier (in UUID4 format) for this + * service. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The resource name for the service in the format + * `projects/*/locations/*/namespaces/*/services/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. The resource name for the service in the format + * `projects/*/locations/*/namespaces/*/services/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Metadata for the service. This data can be consumed by service + * clients. + * Restrictions: + * * The entire metadata dictionary may contain up to 2000 characters, + * spread accoss all key-value pairs. Metadata that goes beyond this + * limit are rejected + * * Valid metadata keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/). + * Metadata that fails to meet these requirements are rejected + * Note: This field is equivalent to the `annotations` field in the v1 API. + * They have the same syntax and read/write to the same location in Service + * Directory. + * + * Generated from protobuf field map metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Optional. Metadata for the service. This data can be consumed by service + * clients. + * Restrictions: + * * The entire metadata dictionary may contain up to 2000 characters, + * spread accoss all key-value pairs. Metadata that goes beyond this + * limit are rejected + * * Valid metadata keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/). + * Metadata that fails to meet these requirements are rejected + * Note: This field is equivalent to the `annotations` field in the v1 API. + * They have the same syntax and read/write to the same location in Service + * Directory. + * + * Generated from protobuf field map metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + + /** + * Output only. Endpoints associated with this service. Returned on + * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. + * Control plane clients should use + * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEndpoints() + { + return $this->endpoints; + } + + /** + * Output only. Endpoints associated with this service. Returned on + * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. + * Control plane clients should use + * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. + * + * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\ServiceDirectory\V1beta1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEndpoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceDirectory\V1beta1\Endpoint::class); + $this->endpoints = $arr; + + return $this; + } + + /** + * Output only. The timestamp when the service was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp when the service was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp when the service was last updated. Note: + * endpoints being created/deleted/updated within the service are not + * considered service updates for the purpose of this timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The timestamp when the service was last updated. Note: + * endpoints being created/deleted/updated within the service are not + * considered service updates for the purpose of this timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * service. + * + * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * service. + * + * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateEndpointRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateEndpointRequest.php new file mode 100644 index 00000000000..b89ff9379ef --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateEndpointRequest.php @@ -0,0 +1,122 @@ +google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest + */ +class UpdateEndpointRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The updated endpoint. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $endpoint = null; + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ServiceDirectory\V1beta1\Endpoint $endpoint + * Required. The updated endpoint. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. List of fields to be updated in this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The updated endpoint. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ServiceDirectory\V1beta1\Endpoint|null + */ + public function getEndpoint() + { + return $this->endpoint; + } + + public function hasEndpoint() + { + return isset($this->endpoint); + } + + public function clearEndpoint() + { + unset($this->endpoint); + } + + /** + * Required. The updated endpoint. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ServiceDirectory\V1beta1\Endpoint $var + * @return $this + */ + public function setEndpoint($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1beta1\Endpoint::class); + $this->endpoint = $var; + + return $this; + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateNamespaceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateNamespaceRequest.php new file mode 100644 index 00000000000..006337b95fe --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateNamespaceRequest.php @@ -0,0 +1,122 @@ +google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest + */ +class UpdateNamespaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The updated namespace. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $namespace = null; + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace $namespace + * Required. The updated namespace. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. List of fields to be updated in this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The updated namespace. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace|null + */ + public function getNamespace() + { + return $this->namespace; + } + + public function hasNamespace() + { + return isset($this->namespace); + } + + public function clearNamespace() + { + unset($this->namespace); + } + + /** + * Required. The updated namespace. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace $var + * @return $this + */ + public function setNamespace($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace::class); + $this->namespace = $var; + + return $this; + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateServiceRequest.php new file mode 100644 index 00000000000..bbbdfcaf1b5 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateServiceRequest.php @@ -0,0 +1,122 @@ +google.cloud.servicedirectory.v1beta1.UpdateServiceRequest + */ +class UpdateServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The updated service. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service = null; + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ServiceDirectory\V1beta1\Service $service + * Required. The updated service. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. List of fields to be updated in this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The updated service. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ServiceDirectory\V1beta1\Service|null + */ + public function getService() + { + return $this->service; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Required. The updated service. + * + * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ServiceDirectory\V1beta1\Service $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1beta1\Service::class); + $this->service = $var; + + return $this; + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/get_location.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/get_location.php new file mode 100644 index 00000000000..f0113472c54 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END servicedirectory_v1beta1_generated_LookupService_GetLocation_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/list_locations.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/list_locations.php new file mode 100644 index 00000000000..b9ea333ed0c --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END servicedirectory_v1beta1_generated_LookupService_ListLocations_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/resolve_service.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/resolve_service.php new file mode 100644 index 00000000000..b6b224d7c80 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/resolve_service.php @@ -0,0 +1,73 @@ +resolveService($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = LookupServiceClient::serviceName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]', + '[SERVICE]' + ); + + resolve_service_sample($formattedName); +} +// [END servicedirectory_v1beta1_generated_LookupService_ResolveService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_endpoint.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_endpoint.php new file mode 100644 index 00000000000..0a04289c651 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_endpoint.php @@ -0,0 +1,82 @@ +RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + */ +function create_endpoint_sample(string $formattedParent, string $endpointId): void +{ + // Create a client. + $registrationServiceClient = new RegistrationServiceClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $endpoint = new Endpoint(); + + // Call the API and handle any network failures. + try { + /** @var Endpoint $response */ + $response = $registrationServiceClient->createEndpoint($formattedParent, $endpointId, $endpoint); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RegistrationServiceClient::serviceName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]', + '[SERVICE]' + ); + $endpointId = '[ENDPOINT_ID]'; + + create_endpoint_sample($formattedParent, $endpointId); +} +// [END servicedirectory_v1beta1_generated_RegistrationService_CreateEndpoint_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_namespace.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_namespace.php new file mode 100644 index 00000000000..e57cb91767a --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_namespace.php @@ -0,0 +1,78 @@ +RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + */ +function create_namespace_sample(string $formattedParent, string $namespaceId): void +{ + // Create a client. + $registrationServiceClient = new RegistrationServiceClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $namespace = new PBNamespace(); + + // Call the API and handle any network failures. + try { + /** @var PBNamespace $response */ + $response = $registrationServiceClient->createNamespace($formattedParent, $namespaceId, $namespace); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RegistrationServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $namespaceId = '[NAMESPACE_ID]'; + + create_namespace_sample($formattedParent, $namespaceId); +} +// [END servicedirectory_v1beta1_generated_RegistrationService_CreateNamespace_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_service.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_service.php new file mode 100644 index 00000000000..1326f6ca08a --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_service.php @@ -0,0 +1,81 @@ +RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + */ +function create_service_sample(string $formattedParent, string $serviceId): void +{ + // Create a client. + $registrationServiceClient = new RegistrationServiceClient(); + + // Prepare any non-scalar elements to be passed along with the request. + $service = new Service(); + + // Call the API and handle any network failures. + try { + /** @var Service $response */ + $response = $registrationServiceClient->createService($formattedParent, $serviceId, $service); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RegistrationServiceClient::namespaceName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]' + ); + $serviceId = '[SERVICE_ID]'; + + create_service_sample($formattedParent, $serviceId); +} +// [END servicedirectory_v1beta1_generated_RegistrationService_CreateService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_endpoint.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_endpoint.php new file mode 100644 index 00000000000..4f3c2ec3f64 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_endpoint.php @@ -0,0 +1,70 @@ +deleteEndpoint($formattedName); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RegistrationServiceClient::endpointName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]', + '[SERVICE]', + '[ENDPOINT]' + ); + + delete_endpoint_sample($formattedName); +} +// [END servicedirectory_v1beta1_generated_RegistrationService_DeleteEndpoint_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_namespace.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_namespace.php new file mode 100644 index 00000000000..cb8301c80a3 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_namespace.php @@ -0,0 +1,65 @@ +deleteNamespace($formattedName); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RegistrationServiceClient::namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + + delete_namespace_sample($formattedName); +} +// [END servicedirectory_v1beta1_generated_RegistrationService_DeleteNamespace_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_service.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_service.php new file mode 100644 index 00000000000..6f4868df43d --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_service.php @@ -0,0 +1,70 @@ +deleteService($formattedName); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RegistrationServiceClient::serviceName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]', + '[SERVICE]' + ); + + delete_service_sample($formattedName); +} +// [END servicedirectory_v1beta1_generated_RegistrationService_DeleteService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_endpoint.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_endpoint.php new file mode 100644 index 00000000000..50f534f1c6b --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_endpoint.php @@ -0,0 +1,72 @@ +getEndpoint($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RegistrationServiceClient::endpointName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]', + '[SERVICE]', + '[ENDPOINT]' + ); + + get_endpoint_sample($formattedName); +} +// [END servicedirectory_v1beta1_generated_RegistrationService_GetEndpoint_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_iam_policy.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_iam_policy.php new file mode 100644 index 00000000000..a284240373f --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_iam_policy.php @@ -0,0 +1,66 @@ +getIamPolicy($resource); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END servicedirectory_v1beta1_generated_RegistrationService_GetIamPolicy_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_location.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_location.php new file mode 100644 index 00000000000..a7b720365a6 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END servicedirectory_v1beta1_generated_RegistrationService_GetLocation_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_namespace.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_namespace.php new file mode 100644 index 00000000000..b7f8d5468e7 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_namespace.php @@ -0,0 +1,66 @@ +getNamespace($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RegistrationServiceClient::namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + + get_namespace_sample($formattedName); +} +// [END servicedirectory_v1beta1_generated_RegistrationService_GetNamespace_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_service.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_service.php new file mode 100644 index 00000000000..5f9f44db352 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_service.php @@ -0,0 +1,71 @@ +getService($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RegistrationServiceClient::serviceName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]', + '[SERVICE]' + ); + + get_service_sample($formattedName); +} +// [END servicedirectory_v1beta1_generated_RegistrationService_GetService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_endpoints.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_endpoints.php new file mode 100644 index 00000000000..fe8cab69c79 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_endpoints.php @@ -0,0 +1,77 @@ +listEndpoints($formattedParent); + + /** @var Endpoint $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RegistrationServiceClient::serviceName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]', + '[SERVICE]' + ); + + list_endpoints_sample($formattedParent); +} +// [END servicedirectory_v1beta1_generated_RegistrationService_ListEndpoints_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_locations.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_locations.php new file mode 100644 index 00000000000..0a3e12c7132 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END servicedirectory_v1beta1_generated_RegistrationService_ListLocations_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_namespaces.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_namespaces.php new file mode 100644 index 00000000000..45fe7c550ee --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_namespaces.php @@ -0,0 +1,72 @@ +listNamespaces($formattedParent); + + /** @var PBNamespace $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RegistrationServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_namespaces_sample($formattedParent); +} +// [END servicedirectory_v1beta1_generated_RegistrationService_ListNamespaces_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_services.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_services.php new file mode 100644 index 00000000000..4ccebc036fc --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_services.php @@ -0,0 +1,76 @@ +listServices($formattedParent); + + /** @var Service $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RegistrationServiceClient::namespaceName( + '[PROJECT]', + '[LOCATION]', + '[NAMESPACE]' + ); + + list_services_sample($formattedParent); +} +// [END servicedirectory_v1beta1_generated_RegistrationService_ListServices_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/set_iam_policy.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/set_iam_policy.php new file mode 100644 index 00000000000..cad3df911fa --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/set_iam_policy.php @@ -0,0 +1,69 @@ +setIamPolicy($resource, $policy); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END servicedirectory_v1beta1_generated_RegistrationService_SetIamPolicy_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/test_iam_permissions.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/test_iam_permissions.php new file mode 100644 index 00000000000..d44f3bffa8c --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/test_iam_permissions.php @@ -0,0 +1,75 @@ +testIamPermissions($resource, $permissions); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END servicedirectory_v1beta1_generated_RegistrationService_TestIamPermissions_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_endpoint.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_endpoint.php new file mode 100644 index 00000000000..f1b42b1d111 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_endpoint.php @@ -0,0 +1,58 @@ +updateEndpoint($endpoint, $updateMask); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END servicedirectory_v1beta1_generated_RegistrationService_UpdateEndpoint_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_namespace.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_namespace.php new file mode 100644 index 00000000000..72578814fac --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_namespace.php @@ -0,0 +1,58 @@ +updateNamespace($namespace, $updateMask); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END servicedirectory_v1beta1_generated_RegistrationService_UpdateNamespace_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_service.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_service.php new file mode 100644 index 00000000000..2080e4dfa2a --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_service.php @@ -0,0 +1,58 @@ +updateService($service, $updateMask); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END servicedirectory_v1beta1_generated_RegistrationService_UpdateService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/Gapic/LookupServiceGapicClient.php b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/Gapic/LookupServiceGapicClient.php new file mode 100644 index 00000000000..3ade4fdee34 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/Gapic/LookupServiceGapicClient.php @@ -0,0 +1,475 @@ +serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + * $response = $lookupServiceClient->resolveService($formattedName); + * } finally { + * $lookupServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @experimental + */ +class LookupServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.servicedirectory.v1beta1.LookupService'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'servicedirectory.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $serviceNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/lookup_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/lookup_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/lookup_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/lookup_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getServiceNameTemplate() + { + if (self::$serviceNameTemplate == null) { + self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}'); + } + + return self::$serviceNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'service' => self::getServiceNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a service + * resource. + * + * @param string $project + * @param string $location + * @param string $namespace + * @param string $service + * + * @return string The formatted service resource. + * + * @experimental + */ + public static function serviceName($project, $location, $namespace, $service) + { + return self::getServiceNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'namespace' => $namespace, + 'service' => $service, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'servicedirectory.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Returns a [service][google.cloud.servicedirectory.v1beta1.Service] and its + * associated endpoints. + * Resolving a service is not considered an active developer method. + * + * Sample code: + * ``` + * $lookupServiceClient = new LookupServiceClient(); + * try { + * $formattedName = $lookupServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + * $response = $lookupServiceClient->resolveService($formattedName); + * } finally { + * $lookupServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the service to resolve. + * @param array $optionalArgs { + * Optional. + * + * @type int $maxEndpoints + * Optional. The maximum number of endpoints to return. Defaults to 25. + * Maximum is 100. If a value less than one is specified, the Default is used. + * If a value greater than the Maximum is specified, the Maximum is used. + * @type string $endpointFilter + * Optional. The filter applied to the endpoints of the resolved service. + * + * General `filter` string syntax: + * ` ()` + * + * * `` can be `name`, `address`, `port`, or `metadata.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * + * Examples of valid filters: + * + * * `metadata.owner` returns endpoints that have a annotation with the key + * `owner`, this is the same as `metadata:owner` + * * `metadata.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` + * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have + * `owner` in annotation key but value is not `sd` AND have key/value + * `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoint, it returns no results + * + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1beta1\ResolveServiceResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function resolveService($name, array $optionalArgs = []) + { + $request = new ResolveServiceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['maxEndpoints'])) { + $request->setMaxEndpoints($optionalArgs['maxEndpoints']); + } + + if (isset($optionalArgs['endpointFilter'])) { + $request->setEndpointFilter($optionalArgs['endpointFilter']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('ResolveService', ResolveServiceResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $lookupServiceClient = new LookupServiceClient(); + * try { + * $response = $lookupServiceClient->getLocation(); + * } finally { + * $lookupServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $lookupServiceClient = new LookupServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $lookupServiceClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $lookupServiceClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $lookupServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/Gapic/RegistrationServiceGapicClient.php b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/Gapic/RegistrationServiceGapicClient.php new file mode 100644 index 00000000000..37d911510ca --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/Gapic/RegistrationServiceGapicClient.php @@ -0,0 +1,1623 @@ +serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + * $endpointId = 'endpoint_id'; + * $endpoint = new Endpoint(); + * $response = $registrationServiceClient->createEndpoint($formattedParent, $endpointId, $endpoint); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @experimental + */ +class RegistrationServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.servicedirectory.v1beta1.RegistrationService'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'servicedirectory.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $endpointNameTemplate; + + private static $locationNameTemplate; + + private static $namespaceNameTemplate; + + private static $networkNameTemplate; + + private static $serviceNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/registration_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/registration_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/registration_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/registration_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getEndpointNameTemplate() + { + if (self::$endpointNameTemplate == null) { + self::$endpointNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}'); + } + + return self::$endpointNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getNamespaceNameTemplate() + { + if (self::$namespaceNameTemplate == null) { + self::$namespaceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}'); + } + + return self::$namespaceNameTemplate; + } + + private static function getNetworkNameTemplate() + { + if (self::$networkNameTemplate == null) { + self::$networkNameTemplate = new PathTemplate('projects/{project}/locations/global/networks/{network}'); + } + + return self::$networkNameTemplate; + } + + private static function getServiceNameTemplate() + { + if (self::$serviceNameTemplate == null) { + self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}'); + } + + return self::$serviceNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'endpoint' => self::getEndpointNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'namespace' => self::getNamespaceNameTemplate(), + 'network' => self::getNetworkNameTemplate(), + 'service' => self::getServiceNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a endpoint + * resource. + * + * @param string $project + * @param string $location + * @param string $namespace + * @param string $service + * @param string $endpoint + * + * @return string The formatted endpoint resource. + * + * @experimental + */ + public static function endpointName($project, $location, $namespace, $service, $endpoint) + { + return self::getEndpointNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'namespace' => $namespace, + 'service' => $service, + 'endpoint' => $endpoint, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + * + * @experimental + */ + public static function locationName($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a namespace + * resource. + * + * @param string $project + * @param string $location + * @param string $namespace + * + * @return string The formatted namespace resource. + * + * @experimental + */ + public static function namespaceName($project, $location, $namespace) + { + return self::getNamespaceNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'namespace' => $namespace, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $project + * @param string $network + * + * @return string The formatted network resource. + * + * @experimental + */ + public static function networkName($project, $network) + { + return self::getNetworkNameTemplate()->render([ + 'project' => $project, + 'network' => $network, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a service + * resource. + * + * @param string $project + * @param string $location + * @param string $namespace + * @param string $service + * + * @return string The formatted service resource. + * + * @experimental + */ + public static function serviceName($project, $location, $namespace, $service) + { + return self::getServiceNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'namespace' => $namespace, + 'service' => $service, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - endpoint: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint} + * - location: projects/{project}/locations/{location} + * - namespace: projects/{project}/locations/{location}/namespaces/{namespace} + * - network: projects/{project}/locations/global/networks/{network} + * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'servicedirectory.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Creates an endpoint, and returns the new endpoint. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedParent = $registrationServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + * $endpointId = 'endpoint_id'; + * $endpoint = new Endpoint(); + * $response = $registrationServiceClient->createEndpoint($formattedParent, $endpointId, $endpoint); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the service that this endpoint provides. + * @param string $endpointId Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * @param Endpoint $endpoint Required. A endpoint with initial fields set. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1beta1\Endpoint + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createEndpoint($parent, $endpointId, $endpoint, array $optionalArgs = []) + { + $request = new CreateEndpointRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setEndpointId($endpointId); + $request->setEndpoint($endpoint); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateEndpoint', Endpoint::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a namespace, and returns the new namespace. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedParent = $registrationServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * $namespaceId = 'namespace_id'; + * $namespace = new PBNamespace(); + * $response = $registrationServiceClient->createNamespace($formattedParent, $namespaceId, $namespace); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the project and location the namespace + * will be created in. + * @param string $namespaceId Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * @param PBNamespace $namespace Required. A namespace with initial fields set. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createNamespace($parent, $namespaceId, $namespace, array $optionalArgs = []) + { + $request = new CreateNamespaceRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setNamespaceId($namespaceId); + $request->setNamespace($namespace); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateNamespace', PBNamespace::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a service, and returns the new service. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedParent = $registrationServiceClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + * $serviceId = 'service_id'; + * $service = new Service(); + * $response = $registrationServiceClient->createService($formattedParent, $serviceId, $service); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the namespace this service will belong to. + * @param string $serviceId Required. The Resource ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + * @param Service $service Required. A service with initial fields set. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1beta1\Service + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createService($parent, $serviceId, $service, array $optionalArgs = []) + { + $request = new CreateServiceRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setServiceId($serviceId); + $request->setService($service); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateService', Service::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes an endpoint. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedName = $registrationServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); + * $registrationServiceClient->deleteEndpoint($formattedName); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the endpoint to delete. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteEndpoint($name, array $optionalArgs = []) + { + $request = new DeleteEndpointRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteEndpoint', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a namespace. This also deletes all services and endpoints in + * the namespace. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedName = $registrationServiceClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + * $registrationServiceClient->deleteNamespace($formattedName); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the namespace to delete. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteNamespace($name, array $optionalArgs = []) + { + $request = new DeleteNamespaceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteNamespace', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a service. This also deletes all endpoints associated with + * the service. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedName = $registrationServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + * $registrationServiceClient->deleteService($formattedName); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the service to delete. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteService($name, array $optionalArgs = []) + { + $request = new DeleteServiceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteService', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets an endpoint. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedName = $registrationServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); + * $response = $registrationServiceClient->getEndpoint($formattedName); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the endpoint to get. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1beta1\Endpoint + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getEndpoint($name, array $optionalArgs = []) + { + $request = new GetEndpointRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetEndpoint', Endpoint::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the IAM Policy for a resource + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $resource = 'resource'; + * $response = $registrationServiceClient->getIamPolicy($resource); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param array $optionalArgs { + * Optional. + * + * @type GetPolicyOptions $options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getIamPolicy($resource, array $optionalArgs = []) + { + $request = new GetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['options'])) { + $request->setOptions($optionalArgs['options']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a namespace. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedName = $registrationServiceClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + * $response = $registrationServiceClient->getNamespace($formattedName); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the namespace to retrieve. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getNamespace($name, array $optionalArgs = []) + { + $request = new GetNamespaceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetNamespace', PBNamespace::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a service. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedName = $registrationServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + * $response = $registrationServiceClient->getService($formattedName); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the service to get. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1beta1\Service + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getService($name, array $optionalArgs = []) + { + $request = new GetServiceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetService', Service::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists all endpoints. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedParent = $registrationServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + * // Iterate over pages of elements + * $pagedResponse = $registrationServiceClient->listEndpoints($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $registrationServiceClient->listEndpoints($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the service whose endpoints you'd like to + * list. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. The filter to list results by. + * + * General `filter` string syntax: + * ` ()` + * + * * `` can be `name`, `address`, `port`, `metadata.` for map + * field, or `attributes.` for attributes field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * + * Examples of valid filters: + * + * * `metadata.owner` returns endpoints that have a metadata with the key + * `owner`, this is the same as `metadata:owner` + * * `metadata.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have + * `owner` in metadata key but value is not `sd` AND have key/value + * `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoints, it returns no results + * * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ + * IP` returns endpoints with the corresponding kubernetes_resource_type + * + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type string $orderBy + * Optional. The order to list results by. + * + * General `order_by` string syntax: ` () (,)` + * + * * `` allows values: `name`, `address`, `port` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listEndpoints($parent, array $optionalArgs = []) + { + $request = new ListEndpointsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListEndpoints', $optionalArgs, ListEndpointsResponse::class, $request); + } + + /** + * Lists all namespaces. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedParent = $registrationServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $registrationServiceClient->listNamespaces($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $registrationServiceClient->listNamespaces($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the project and location whose namespaces + * you'd like to list. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. The filter to list results by. + * + * General `filter` string syntax: + * ` ()` + * + * * `` can be `name`, `labels.` for map field, or + * `attributes.` for attributes field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * + * Examples of valid filters: + * + * * `labels.owner` returns namespaces that have a label with the key + * `owner`, this is the same as `labels:owner` + * * `labels.owner=sd` returns namespaces that have key/value `owner=sd` + * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + * returns namespaces that have name that is alphabetically later than the + * string, so "namespace-e" is returned but "namespace-a" is not + * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + * `owner` in label key but value is not `sd` AND have key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that namespace + * doesn't have a field called "doesnotexist". Since the filter does not + * match any namespaces, it returns no results + * * `attributes.managed_registration=true` returns namespaces that are + * managed by a GCP product or service + * + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type string $orderBy + * Optional. The order to list results by. + * + * General `order_by` string syntax: ` () (,)` + * + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listNamespaces($parent, array $optionalArgs = []) + { + $request = new ListNamespacesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListNamespaces', $optionalArgs, ListNamespacesResponse::class, $request); + } + + /** + * Lists all services belonging to a namespace. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $formattedParent = $registrationServiceClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + * // Iterate over pages of elements + * $pagedResponse = $registrationServiceClient->listServices($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $registrationServiceClient->listServices($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the namespace whose services you'd + * like to list. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. The filter to list results by. + * + * General `filter` string syntax: + * ` ()` + * + * * `` can be `name` or `metadata.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` + * + * Examples of valid filters: + * + * * `metadata.owner` returns services that have a metadata with the key + * `owner`, this is the same as `metadata:owner` + * * `metadata.protocol=gRPC` returns services that have key/value + * `protocol=gRPC` + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + * returns services that have name that is alphabetically later than the + * string, so "service-e" is returned but "service-a" is not + * * `metadata.owner!=sd AND metadata.foo=bar` returns services that have + * `owner` in metadata key but value is not `sd` AND have key/value + * `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that service + * doesn't have a field called "doesnotexist". Since the filter does not + * match any services, it returns no results + * * `attributes.managed_registration=true` returns services that are + * managed + * by a GCP product or service + * + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type string $orderBy + * Optional. The order to list results by. + * + * General `order_by` string syntax: ` () (,)` + * + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listServices($parent, array $optionalArgs = []) + { + $request = new ListServicesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListServices', $optionalArgs, ListServicesResponse::class, $request); + } + + /** + * Sets the IAM Policy for a resource + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $registrationServiceClient->setIamPolicy($resource, $policy); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function setIamPolicy($resource, $policy, array $optionalArgs = []) + { + $request = new SetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPolicy($policy); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Tests IAM permissions for a resource (namespace, service or + * service workload only). + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $registrationServiceClient->testIamPermissions($resource, $permissions); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param string $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[] $permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function testIamPermissions($resource, $permissions, array $optionalArgs = []) + { + $request = new TestIamPermissionsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPermissions($permissions); + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates an endpoint. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $endpoint = new Endpoint(); + * $updateMask = new FieldMask(); + * $response = $registrationServiceClient->updateEndpoint($endpoint, $updateMask); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param Endpoint $endpoint Required. The updated endpoint. + * @param FieldMask $updateMask Required. List of fields to be updated in this request. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1beta1\Endpoint + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function updateEndpoint($endpoint, $updateMask, array $optionalArgs = []) + { + $request = new UpdateEndpointRequest(); + $requestParamHeaders = []; + $request->setEndpoint($endpoint); + $request->setUpdateMask($updateMask); + $requestParamHeaders['endpoint.name'] = $endpoint->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateEndpoint', Endpoint::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates a namespace. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $namespace = new PBNamespace(); + * $updateMask = new FieldMask(); + * $response = $registrationServiceClient->updateNamespace($namespace, $updateMask); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param PBNamespace $namespace Required. The updated namespace. + * @param FieldMask $updateMask Required. List of fields to be updated in this request. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function updateNamespace($namespace, $updateMask, array $optionalArgs = []) + { + $request = new UpdateNamespaceRequest(); + $requestParamHeaders = []; + $request->setNamespace($namespace); + $request->setUpdateMask($updateMask); + $requestParamHeaders['namespace.name'] = $namespace->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateNamespace', PBNamespace::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates a service. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $service = new Service(); + * $updateMask = new FieldMask(); + * $response = $registrationServiceClient->updateService($service, $updateMask); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param Service $service Required. The updated service. + * @param FieldMask $updateMask Required. List of fields to be updated in this request. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\ServiceDirectory\V1beta1\Service + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function updateService($service, $updateMask, array $optionalArgs = []) + { + $request = new UpdateServiceRequest(); + $requestParamHeaders = []; + $request->setService($service); + $request->setUpdateMask($updateMask); + $requestParamHeaders['service.name'] = $service->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateService', Service::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $response = $registrationServiceClient->getLocation(); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $registrationServiceClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $registrationServiceClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/LookupServiceClient.php b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/LookupServiceClient.php new file mode 100644 index 00000000000..1b19f60f74e --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/LookupServiceClient.php @@ -0,0 +1,36 @@ + [ + 'google.cloud.servicedirectory.v1beta1.LookupService' => [ + 'GetLocation' => [ + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + ], + ], +]; diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/lookup_service_rest_client_config.php b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/lookup_service_rest_client_config.php new file mode 100644 index 00000000000..c72aa8fc1ef --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/lookup_service_rest_client_config.php @@ -0,0 +1,45 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.servicedirectory.v1beta1.LookupService' => [ + 'ResolveService' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}:resolve', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_client_config.json b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_client_config.json new file mode 100644 index 00000000000..3b641390ccc --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_client_config.json @@ -0,0 +1,135 @@ +{ + "interfaces": { + "google.cloud.servicedirectory.v1beta1.RegistrationService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "UNKNOWN" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 15000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 15000, + "total_timeout_millis": 15000 + } + }, + "methods": { + "CreateEndpoint": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateNamespace": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateService": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteEndpoint": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteNamespace": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteService": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetEndpoint": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetNamespace": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetService": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListEndpoints": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListNamespaces": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListServices": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateEndpoint": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateNamespace": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateService": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_descriptor_config.php b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_descriptor_config.php new file mode 100644 index 00000000000..57d31357db0 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_descriptor_config.php @@ -0,0 +1,52 @@ + [ + 'google.cloud.servicedirectory.v1beta1.RegistrationService' => [ + 'ListEndpoints' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEndpoints', + ], + ], + 'ListNamespaces' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getNamespaces', + ], + ], + 'ListServices' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getServices', + ], + ], + 'GetLocation' => [ + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + ], + ], +]; diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_rest_client_config.php b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_rest_client_config.php new file mode 100644 index 00000000000..d9a4440f356 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_rest_client_config.php @@ -0,0 +1,297 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.servicedirectory.v1beta1.RegistrationService' => [ + 'CreateEndpoint' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints', + 'body' => 'endpoint', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'endpoint_id', + ], + ], + 'CreateNamespace' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*}/namespaces', + 'body' => 'namespace', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'namespace_id', + ], + ], + 'CreateService' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/namespaces/*}/services', + 'body' => 'service', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'service_id', + ], + ], + 'DeleteEndpoint' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteNamespace' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/namespaces/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteService' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetEndpoint' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*}:getIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:getIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:getIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetNamespace' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/namespaces/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetService' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListEndpoints' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListNamespaces' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*}/namespaces', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListServices' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/namespaces/*}/services', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateEndpoint' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1beta1/{endpoint.name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}', + 'body' => 'endpoint', + 'placeholders' => [ + 'endpoint.name' => [ + 'getters' => [ + 'getEndpoint', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateNamespace' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1beta1/{namespace.name=projects/*/locations/*/namespaces/*}', + 'body' => 'namespace', + 'placeholders' => [ + 'namespace.name' => [ + 'getters' => [ + 'getNamespace', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateService' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1beta1/{service.name=projects/*/locations/*/namespaces/*/services/*}', + 'body' => 'service', + 'placeholders' => [ + 'service.name' => [ + 'getters' => [ + 'getService', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/tests/Unit/V1beta1/LookupServiceClientTest.php b/owl-bot-staging/ServiceDirectory/v1beta1/tests/Unit/V1beta1/LookupServiceClientTest.php new file mode 100644 index 00000000000..c753ea00a15 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/tests/Unit/V1beta1/LookupServiceClientTest.php @@ -0,0 +1,241 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return LookupServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new LookupServiceClient($options); + } + + /** @test */ + public function resolveServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ResolveServiceResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $response = $gapicClient->resolveService($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.LookupService/ResolveService', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resolveServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + try { + $gapicClient->resolveService($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/tests/Unit/V1beta1/RegistrationServiceClientTest.php b/owl-bot-staging/ServiceDirectory/v1beta1/tests/Unit/V1beta1/RegistrationServiceClientTest.php new file mode 100644 index 00000000000..e4545fe0970 --- /dev/null +++ b/owl-bot-staging/ServiceDirectory/v1beta1/tests/Unit/V1beta1/RegistrationServiceClientTest.php @@ -0,0 +1,1369 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegistrationServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegistrationServiceClient($options); + } + + /** @test */ + public function createEndpointTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $address = 'address-1147692044'; + $port = 3446913; + $network = 'network1843485230'; + $uid = 'uid115792'; + $expectedResponse = new Endpoint(); + $expectedResponse->setName($name); + $expectedResponse->setAddress($address); + $expectedResponse->setPort($port); + $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $endpointId = 'endpointId-1135808507'; + $endpoint = new Endpoint(); + $response = $gapicClient->createEndpoint($formattedParent, $endpointId, $endpoint); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/CreateEndpoint', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getEndpointId(); + $this->assertProtobufEquals($endpointId, $actualValue); + $actualValue = $actualRequestObject->getEndpoint(); + $this->assertProtobufEquals($endpoint, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createEndpointExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $endpointId = 'endpointId-1135808507'; + $endpoint = new Endpoint(); + try { + $gapicClient->createEndpoint($formattedParent, $endpointId, $endpoint); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createNamespaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new PBNamespace(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $namespaceId = 'namespaceId-1253352833'; + $namespace = new PBNamespace(); + $response = $gapicClient->createNamespace($formattedParent, $namespaceId, $namespace); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/CreateNamespace', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getNamespaceId(); + $this->assertProtobufEquals($namespaceId, $actualValue); + $actualValue = $actualRequestObject->getNamespace(); + $this->assertProtobufEquals($namespace, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createNamespaceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $namespaceId = 'namespaceId-1253352833'; + $namespace = new PBNamespace(); + try { + $gapicClient->createNamespace($formattedParent, $namespaceId, $namespace); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new Service(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $serviceId = 'serviceId-1724763419'; + $service = new Service(); + $response = $gapicClient->createService($formattedParent, $serviceId, $service); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/CreateService', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getServiceId(); + $this->assertProtobufEquals($serviceId, $actualValue); + $actualValue = $actualRequestObject->getService(); + $this->assertProtobufEquals($service, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $serviceId = 'serviceId-1724763419'; + $service = new Service(); + try { + $gapicClient->createService($formattedParent, $serviceId, $service); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteEndpointTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); + $gapicClient->deleteEndpoint($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/DeleteEndpoint', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteEndpointExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); + try { + $gapicClient->deleteEndpoint($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteNamespaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $gapicClient->deleteNamespace($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/DeleteNamespace', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteNamespaceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + try { + $gapicClient->deleteNamespace($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $gapicClient->deleteService($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/DeleteService', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + try { + $gapicClient->deleteService($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEndpointTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $address = 'address-1147692044'; + $port = 3446913; + $network = 'network1843485230'; + $uid = 'uid115792'; + $expectedResponse = new Endpoint(); + $expectedResponse->setName($name2); + $expectedResponse->setAddress($address); + $expectedResponse->setPort($port); + $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); + $response = $gapicClient->getEndpoint($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/GetEndpoint', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEndpointExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); + try { + $gapicClient->getEndpoint($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($resource); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($resource); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNamespaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $expectedResponse = new PBNamespace(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $response = $gapicClient->getNamespace($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/GetNamespace', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNamespaceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + try { + $gapicClient->getNamespace($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $expectedResponse = new Service(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $response = $gapicClient->getService($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/GetService', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + try { + $gapicClient->getService($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEndpointsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $endpointsElement = new Endpoint(); + $endpoints = [ + $endpointsElement, + ]; + $expectedResponse = new ListEndpointsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setEndpoints($endpoints); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + $response = $gapicClient->listEndpoints($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getEndpoints()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/ListEndpoints', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEndpointsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); + try { + $gapicClient->listEndpoints($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNamespacesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $namespacesElement = new PBNamespace(); + $namespaces = [ + $namespacesElement, + ]; + $expectedResponse = new ListNamespacesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setNamespaces($namespaces); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listNamespaces($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getNamespaces()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/ListNamespaces', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNamespacesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listNamespaces($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listServicesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $servicesElement = new Service(); + $services = [ + $servicesElement, + ]; + $expectedResponse = new ListServicesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setServices($services); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + $response = $gapicClient->listServices($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/ListServices', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listServicesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); + try { + $gapicClient->listServices($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $gapicClient->setIamPolicy($resource, $policy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + try { + $gapicClient->setIamPolicy($resource, $policy); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $gapicClient->testIamPermissions($resource, $permissions); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + try { + $gapicClient->testIamPermissions($resource, $permissions); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEndpointTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $address = 'address-1147692044'; + $port = 3446913; + $network = 'network1843485230'; + $uid = 'uid115792'; + $expectedResponse = new Endpoint(); + $expectedResponse->setName($name); + $expectedResponse->setAddress($address); + $expectedResponse->setPort($port); + $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $endpoint = new Endpoint(); + $updateMask = new FieldMask(); + $response = $gapicClient->updateEndpoint($endpoint, $updateMask); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/UpdateEndpoint', $actualFuncCall); + $actualValue = $actualRequestObject->getEndpoint(); + $this->assertProtobufEquals($endpoint, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEndpointExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $endpoint = new Endpoint(); + $updateMask = new FieldMask(); + try { + $gapicClient->updateEndpoint($endpoint, $updateMask); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateNamespaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new PBNamespace(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $namespace = new PBNamespace(); + $updateMask = new FieldMask(); + $response = $gapicClient->updateNamespace($namespace, $updateMask); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/UpdateNamespace', $actualFuncCall); + $actualValue = $actualRequestObject->getNamespace(); + $this->assertProtobufEquals($namespace, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateNamespaceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $namespace = new PBNamespace(); + $updateMask = new FieldMask(); + try { + $gapicClient->updateNamespace($namespace, $updateMask); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new Service(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $service = new Service(); + $updateMask = new FieldMask(); + $response = $gapicClient->updateService($service, $updateMask); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/UpdateService', $actualFuncCall); + $actualValue = $actualRequestObject->getService(); + $this->assertProtobufEquals($service, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $service = new Service(); + $updateMask = new FieldMask(); + try { + $gapicClient->updateService($service, $updateMask); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} From 7389d8eeb311d0de08e7f7c2bcc2fb6e51fe5986 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 20 Jul 2023 22:13:07 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- ServiceDirectory/metadata/V1/Endpoint.php | 14 +- ServiceDirectory/metadata/V1/PBNamespace.php | 7 +- ServiceDirectory/metadata/V1/Service.php | 7 +- .../metadata/V1Beta1/Endpoint.php | 7 +- .../metadata/V1Beta1/LookupService.php | 4 +- .../metadata/V1Beta1/PBNamespace.php | 7 +- .../metadata/V1Beta1/RegistrationService.php | 12 +- ServiceDirectory/metadata/V1Beta1/Service.php | 7 +- .../V1/LookupServiceClient/get_location.php | 0 .../V1/LookupServiceClient/list_locations.php | 0 .../create_endpoint.php | 2 +- .../create_namespace.php | 2 +- .../create_service.php | 2 +- .../delete_endpoint.php | 2 +- .../get_endpoint.php | 2 +- .../get_location.php | 0 .../list_endpoints.php | 2 +- .../list_locations.php | 0 .../list_namespaces.php | 2 +- .../list_services.php | 2 +- .../update_endpoint.php | 2 +- .../LookupServiceClient/get_location.php | 0 .../LookupServiceClient/list_locations.php | 0 .../get_iam_policy.php | 2 +- .../get_location.php | 0 .../list_locations.php | 0 .../list_namespaces.php | 4 +- .../set_iam_policy.php | 2 +- .../test_iam_permissions.php | 3 +- .../BaseClient/LookupServiceBaseClient.php | 54 + .../RegistrationServiceBaseClient.php | 83 +- ServiceDirectory/src/V1/Endpoint.php | 280 ++- .../src/V1/Gapic/LookupServiceGapicClient.php | 191 +- .../Gapic/RegistrationServiceGapicClient.php | 380 +++- ServiceDirectory/src/V1/GetServiceRequest.php | 4 +- .../src/V1/ListEndpointsRequest.php | 238 ++- .../src/V1/ListNamespacesRequest.php | 238 +-- .../src/V1/ListServicesRequest.php | 218 ++- ServiceDirectory/src/V1/PBNamespace.php | 54 +- .../src/V1/ResolveServiceRequest.php | 172 +- ServiceDirectory/src/V1/Service.php | 170 +- ServiceDirectory/src/V1/gapic_metadata.json | 20 + .../lookup_service_client_config.json | 10 + .../lookup_service_descriptor_config.php | 34 + .../lookup_service_rest_client_config.php | 24 + .../registration_service_client_config.json | 10 + ...registration_service_descriptor_config.php | 35 + ...egistration_service_rest_client_config.php | 24 + .../src/V1beta1/CreateEndpointRequest.php | 3 +- .../src/V1beta1/CreateNamespaceRequest.php | 3 +- .../src/V1beta1/CreateServiceRequest.php | 3 +- .../src/V1beta1/DeleteEndpointRequest.php | 3 +- .../src/V1beta1/DeleteNamespaceRequest.php | 3 +- .../src/V1beta1/DeleteServiceRequest.php | 3 +- ServiceDirectory/src/V1beta1/Endpoint.php | 82 +- .../Gapic/LookupServiceGapicClient.php | 156 +- .../Gapic/RegistrationServiceGapicClient.php | 174 +- .../src/V1beta1/GetEndpointRequest.php | 3 +- .../src/V1beta1/GetNamespaceRequest.php | 3 +- .../src/V1beta1/GetServiceRequest.php | 5 +- .../src/V1beta1/ListEndpointsRequest.php | 27 +- .../src/V1beta1/ListEndpointsResponse.php | 3 +- .../src/V1beta1/ListNamespacesRequest.php | 51 +- .../src/V1beta1/ListNamespacesResponse.php | 3 +- .../src/V1beta1/ListServicesRequest.php | 15 +- .../src/V1beta1/ListServicesResponse.php | 3 +- ServiceDirectory/src/V1beta1/PBNamespace.php | 38 + .../src/V1beta1/ResolveServiceRequest.php | 31 +- .../src/V1beta1/ResolveServiceResponse.php | 3 +- ServiceDirectory/src/V1beta1/Service.php | 90 +- .../src/V1beta1/UpdateEndpointRequest.php | 3 +- .../src/V1beta1/UpdateNamespaceRequest.php | 3 +- .../src/V1beta1/UpdateServiceRequest.php | 3 +- .../src/V1beta1/gapic_metadata.json | 20 + .../lookup_service_client_config.json | 10 + .../lookup_service_descriptor_config.php | 17 +- .../registration_service_client_config.json | 10 + ...registration_service_descriptor_config.php | 14 + ...egistration_service_rest_client_config.php | 15 + .../V1/Client/LookupServiceClientTest.php | 128 ++ .../Client/RegistrationServiceClientTest.php | 156 ++ .../tests/Unit/V1/LookupServiceClientTest.php | 122 ++ .../Unit/V1/RegistrationServiceClientTest.php | 146 ++ .../Unit/V1beta1/LookupServiceClientTest.php | 122 ++ .../V1beta1/RegistrationServiceClientTest.php | 140 ++ .../Cloud/Servicedirectory/V1/Endpoint.php | 42 - .../Servicedirectory/V1/LookupService.php | 41 - .../Cloud/Servicedirectory/V1/PBNamespace.php | 37 - .../V1/RegistrationService.php | 135 -- .../Cloud/Servicedirectory/V1/Service.php | 39 - .../V1/CreateEndpointRequest.php | 194 -- .../V1/CreateNamespaceRequest.php | 199 -- .../V1/CreateServiceRequest.php | 194 -- .../V1/DeleteEndpointRequest.php | 82 - .../V1/DeleteNamespaceRequest.php | 82 - .../V1/DeleteServiceRequest.php | 82 - .../Cloud/ServiceDirectory/V1/Endpoint.php | 359 ---- .../V1/GetEndpointRequest.php | 84 - .../V1/GetNamespaceRequest.php | 82 - .../ServiceDirectory/V1/GetServiceRequest.php | 84 - .../V1/ListEndpointsRequest.php | 359 ---- .../V1/ListEndpointsResponse.php | 106 -- .../V1/ListNamespacesRequest.php | 339 ---- .../V1/ListNamespacesResponse.php | 106 -- .../V1/ListServicesRequest.php | 347 ---- .../V1/ListServicesResponse.php | 106 -- .../Cloud/ServiceDirectory/V1/PBNamespace.php | 153 -- .../V1/ResolveServiceRequest.php | 265 --- .../V1/ResolveServiceResponse.php | 71 - .../Cloud/ServiceDirectory/V1/Service.php | 256 --- .../V1/UpdateEndpointRequest.php | 137 -- .../V1/UpdateNamespaceRequest.php | 137 -- .../V1/UpdateServiceRequest.php | 137 -- .../LookupServiceClient/resolve_service.php | 73 - .../create_endpoint.php | 82 - .../create_namespace.php | 78 - .../create_service.php | 81 - .../delete_endpoint.php | 70 - .../delete_namespace.php | 65 - .../delete_service.php | 70 - .../get_endpoint.php | 72 - .../get_iam_policy.php | 66 - .../get_namespace.php | 66 - .../RegistrationServiceClient/get_service.php | 71 - .../list_endpoints.php | 77 - .../list_namespaces.php | 72 - .../list_services.php | 76 - .../set_iam_policy.php | 69 - .../test_iam_permissions.php | 74 - .../update_endpoint.php | 58 - .../update_namespace.php | 58 - .../update_service.php | 58 - .../BaseClient/LookupServiceBaseClient.php | 296 --- .../RegistrationServiceBaseClient.php | 830 --------- .../v1/src/V1/Client/LookupServiceClient.php | 40 - .../V1/Client/RegistrationServiceClient.php | 40 - .../src/V1/Gapic/LookupServiceGapicClient.php | 463 ----- .../Gapic/RegistrationServiceGapicClient.php | 1561 ---------------- .../v1/src/V1/LookupServiceClient.php | 34 - .../v1/src/V1/RegistrationServiceClient.php | 34 - .../v1/src/V1/gapic_metadata.json | 142 -- .../lookup_service_client_config.json | 50 - .../lookup_service_descriptor_config.php | 57 - .../lookup_service_rest_client_config.php | 45 - .../registration_service_client_config.json | 135 -- ...registration_service_descriptor_config.php | 292 --- ...egistration_service_rest_client_config.php | 282 --- .../V1/Client/LookupServiceClientTest.php | 279 --- .../Client/RegistrationServiceClientTest.php | 1532 ---------------- .../tests/Unit/V1/LookupServiceClientTest.php | 241 --- .../Unit/V1/RegistrationServiceClientTest.php | 1369 -------------- .../Servicedirectory/V1Beta1/Endpoint.php | 45 - .../V1Beta1/LookupService.php | 41 - .../Servicedirectory/V1Beta1/PBNamespace.php | 40 - .../V1Beta1/RegistrationService.php | 135 -- .../Servicedirectory/V1Beta1/Service.php | 42 - .../V1beta1/CreateEndpointRequest.php | 170 -- .../V1beta1/CreateNamespaceRequest.php | 174 -- .../V1beta1/CreateServiceRequest.php | 170 -- .../V1beta1/DeleteEndpointRequest.php | 68 - .../V1beta1/DeleteNamespaceRequest.php | 68 - .../V1beta1/DeleteServiceRequest.php | 68 - .../ServiceDirectory/V1beta1/Endpoint.php | 447 ----- .../V1beta1/GetEndpointRequest.php | 70 - .../V1beta1/GetNamespaceRequest.php | 68 - .../V1beta1/GetServiceRequest.php | 70 - .../V1beta1/ListEndpointsRequest.php | 352 ---- .../V1beta1/ListEndpointsResponse.php | 106 -- .../V1beta1/ListNamespacesRequest.php | 332 ---- .../V1beta1/ListNamespacesResponse.php | 106 -- .../V1beta1/ListServicesRequest.php | 344 ---- .../V1beta1/ListServicesResponse.php | 106 -- .../ServiceDirectory/V1beta1/PBNamespace.php | 241 --- .../V1beta1/ResolveServiceRequest.php | 265 --- .../V1beta1/ResolveServiceResponse.php | 71 - .../ServiceDirectory/V1beta1/Service.php | 352 ---- .../V1beta1/UpdateEndpointRequest.php | 122 -- .../V1beta1/UpdateNamespaceRequest.php | 122 -- .../V1beta1/UpdateServiceRequest.php | 122 -- .../LookupServiceClient/resolve_service.php | 73 - .../create_endpoint.php | 82 - .../create_namespace.php | 78 - .../create_service.php | 81 - .../delete_endpoint.php | 70 - .../delete_namespace.php | 65 - .../delete_service.php | 70 - .../get_endpoint.php | 72 - .../get_iam_policy.php | 66 - .../get_namespace.php | 66 - .../RegistrationServiceClient/get_service.php | 71 - .../list_endpoints.php | 77 - .../list_namespaces.php | 72 - .../list_services.php | 76 - .../set_iam_policy.php | 69 - .../test_iam_permissions.php | 75 - .../update_endpoint.php | 58 - .../update_namespace.php | 58 - .../update_service.php | 58 - .../Gapic/LookupServiceGapicClient.php | 475 ----- .../Gapic/RegistrationServiceGapicClient.php | 1623 ----------------- .../src/V1beta1/LookupServiceClient.php | 36 - .../src/V1beta1/RegistrationServiceClient.php | 36 - .../v1beta1/src/V1beta1/gapic_metadata.json | 142 -- .../lookup_service_client_config.json | 50 - .../lookup_service_descriptor_config.php | 22 - .../lookup_service_rest_client_config.php | 45 - .../registration_service_client_config.json | 135 -- ...registration_service_descriptor_config.php | 52 - ...egistration_service_rest_client_config.php | 297 --- .../Unit/V1beta1/LookupServiceClientTest.php | 241 --- .../V1beta1/RegistrationServiceClientTest.php | 1369 -------------- 211 files changed, 3138 insertions(+), 24299 deletions(-) rename {owl-bot-staging/ServiceDirectory/v1 => ServiceDirectory}/samples/V1/LookupServiceClient/get_location.php (100%) rename {owl-bot-staging/ServiceDirectory/v1 => ServiceDirectory}/samples/V1/LookupServiceClient/list_locations.php (100%) rename {owl-bot-staging/ServiceDirectory/v1 => ServiceDirectory}/samples/V1/RegistrationServiceClient/get_location.php (100%) rename {owl-bot-staging/ServiceDirectory/v1 => ServiceDirectory}/samples/V1/RegistrationServiceClient/list_locations.php (100%) rename {owl-bot-staging/ServiceDirectory/v1beta1 => ServiceDirectory}/samples/V1beta1/LookupServiceClient/get_location.php (100%) rename {owl-bot-staging/ServiceDirectory/v1beta1 => ServiceDirectory}/samples/V1beta1/LookupServiceClient/list_locations.php (100%) rename {owl-bot-staging/ServiceDirectory/v1beta1 => ServiceDirectory}/samples/V1beta1/RegistrationServiceClient/get_location.php (100%) rename {owl-bot-staging/ServiceDirectory/v1beta1 => ServiceDirectory}/samples/V1beta1/RegistrationServiceClient/list_locations.php (100%) delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/Endpoint.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/LookupService.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/PBNamespace.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/RegistrationService.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/Service.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateEndpointRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateNamespaceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateServiceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteEndpointRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteNamespaceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteServiceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/Endpoint.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetEndpointRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetNamespaceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetServiceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListEndpointsRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListEndpointsResponse.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListNamespacesRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListNamespacesResponse.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListServicesRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListServicesResponse.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/PBNamespace.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ResolveServiceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ResolveServiceResponse.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/Service.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateEndpointRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateNamespaceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateServiceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/resolve_service.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_endpoint.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_namespace.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_service.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_endpoint.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_namespace.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_service.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_endpoint.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_iam_policy.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_namespace.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_service.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_endpoints.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_namespaces.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_services.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/set_iam_policy.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_endpoint.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_namespace.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_service.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/Client/BaseClient/LookupServiceBaseClient.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/Client/BaseClient/RegistrationServiceBaseClient.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/Client/LookupServiceClient.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/Client/RegistrationServiceClient.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/Gapic/LookupServiceGapicClient.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/Gapic/RegistrationServiceGapicClient.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/LookupServiceClient.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/RegistrationServiceClient.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/resources/lookup_service_client_config.json delete mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/resources/lookup_service_descriptor_config.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/resources/lookup_service_rest_client_config.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_client_config.json delete mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_descriptor_config.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_rest_client_config.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/Client/LookupServiceClientTest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/Client/RegistrationServiceClientTest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/LookupServiceClientTest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/RegistrationServiceClientTest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/Endpoint.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/LookupService.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/PBNamespace.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/RegistrationService.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/Service.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateEndpointRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateNamespaceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateServiceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteEndpointRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteNamespaceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteServiceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/Endpoint.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetEndpointRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetNamespaceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetServiceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListEndpointsRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListEndpointsResponse.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListNamespacesRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListNamespacesResponse.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListServicesRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListServicesResponse.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/PBNamespace.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ResolveServiceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ResolveServiceResponse.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/Service.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateEndpointRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateNamespaceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateServiceRequest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/resolve_service.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_endpoint.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_namespace.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_service.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_endpoint.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_namespace.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_service.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_endpoint.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_iam_policy.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_namespace.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_service.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_endpoints.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_namespaces.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_services.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/set_iam_policy.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_endpoint.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_namespace.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_service.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/Gapic/LookupServiceGapicClient.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/Gapic/RegistrationServiceGapicClient.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/LookupServiceClient.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/RegistrationServiceClient.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/lookup_service_client_config.json delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/lookup_service_descriptor_config.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/lookup_service_rest_client_config.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_client_config.json delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_descriptor_config.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_rest_client_config.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/tests/Unit/V1beta1/LookupServiceClientTest.php delete mode 100644 owl-bot-staging/ServiceDirectory/v1beta1/tests/Unit/V1beta1/RegistrationServiceClientTest.php diff --git a/ServiceDirectory/metadata/V1/Endpoint.php b/ServiceDirectory/metadata/V1/Endpoint.php index e93e9979eaa..0ca6bf3933c 100644 --- a/ServiceDirectory/metadata/V1/Endpoint.php +++ b/ServiceDirectory/metadata/V1/Endpoint.php @@ -18,18 +18,22 @@ public static function initOnce() { \GPBMetadata\Google\Api\Resource::initOnce(); $pool->internalAddGeneratedFile( ' - -/google/cloud/servicedirectory/v1/endpoint.proto google.cloud.servicedirectory.v1google/api/resource.proto" + +/google/cloud/servicedirectory/v1/endpoint.proto google.cloud.servicedirectory.v1google/api/resource.proto" Endpoint name ( BA address ( BA port (BAU - annotations ( 2;.google.cloud.servicedirectory.v1.Endpoint.AnnotationsEntryBA2 + annotations ( 2;.google.cloud.servicedirectory.v1.Endpoint.AnnotationsEntryBA@ +network ( B/AA) +\'servicedirectory.googleapis.com/Network +uid ( BA2 AnnotationsEntry key (  value ( :8:A -(servicedirectory.googleapis.com/Endpointfprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}B -$com.google.cloud.servicedirectory.v1B EndpointProtoPZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb Google.Cloud.ServiceDirectory.V1 Google\\Cloud\\ServiceDirectory\\V1#Google::Cloud::ServiceDirectory::V1bproto3' +(servicedirectory.googleapis.com/Endpointfprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}B +$com.google.cloud.servicedirectory.v1B EndpointProtoPZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb Google.Cloud.ServiceDirectory.V1 Google\\Cloud\\ServiceDirectory\\V1#Google::Cloud::ServiceDirectory::V1Aa +\'servicedirectory.googleapis.com/Network6projects/{project}/locations/global/networks/{network}bproto3' , true); static::$is_initialized = true; diff --git a/ServiceDirectory/metadata/V1/PBNamespace.php b/ServiceDirectory/metadata/V1/PBNamespace.php index 6af0e19249f..90e97166da9 100644 --- a/ServiceDirectory/metadata/V1/PBNamespace.php +++ b/ServiceDirectory/metadata/V1/PBNamespace.php @@ -18,11 +18,12 @@ public static function initOnce() { \GPBMetadata\Google\Api\Resource::initOnce(); $pool->internalAddGeneratedFile( ' - -0google/cloud/servicedirectory/v1/namespace.proto google.cloud.servicedirectory.v1google/api/resource.proto" + +0google/cloud/servicedirectory/v1/namespace.proto google.cloud.servicedirectory.v1google/api/resource.proto" Namespace name ( BAL -labels ( 27.google.cloud.servicedirectory.v1.Namespace.LabelsEntryBA- +labels ( 27.google.cloud.servicedirectory.v1.Namespace.LabelsEntryBA +uid ( BA- LabelsEntry key (  value ( :8:nAk diff --git a/ServiceDirectory/metadata/V1/Service.php b/ServiceDirectory/metadata/V1/Service.php index e7220a13890..f2fbabaaef6 100644 --- a/ServiceDirectory/metadata/V1/Service.php +++ b/ServiceDirectory/metadata/V1/Service.php @@ -19,12 +19,13 @@ public static function initOnce() { \GPBMetadata\Google\Cloud\Servicedirectory\V1\Endpoint::initOnce(); $pool->internalAddGeneratedFile( ' - -.google/cloud/servicedirectory/v1/service.proto google.cloud.servicedirectory.v1google/api/resource.proto/google/cloud/servicedirectory/v1/endpoint.proto" + +.google/cloud/servicedirectory/v1/service.proto google.cloud.servicedirectory.v1google/api/resource.proto/google/cloud/servicedirectory/v1/endpoint.proto" Service name ( BAT annotations ( 2:.google.cloud.servicedirectory.v1.Service.AnnotationsEntryBAB - endpoints ( 2*.google.cloud.servicedirectory.v1.EndpointBA2 + endpoints ( 2*.google.cloud.servicedirectory.v1.EndpointBA +uid ( BA2 AnnotationsEntry key (  value ( :8:A| diff --git a/ServiceDirectory/metadata/V1Beta1/Endpoint.php b/ServiceDirectory/metadata/V1Beta1/Endpoint.php index 5a1757b30b1..8194fe79c6f 100644 --- a/ServiceDirectory/metadata/V1Beta1/Endpoint.php +++ b/ServiceDirectory/metadata/V1Beta1/Endpoint.php @@ -19,8 +19,8 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' - -4google/cloud/servicedirectory/v1beta1/endpoint.proto%google.cloud.servicedirectory.v1beta1google/api/resource.protogoogle/protobuf/timestamp.proto" + +4google/cloud/servicedirectory/v1beta1/endpoint.proto%google.cloud.servicedirectory.v1beta1google/api/resource.protogoogle/protobuf/timestamp.proto" Endpoint name ( BA address ( BA @@ -29,7 +29,8 @@ public static function initOnce() { network ( B/AA) \'servicedirectory.googleapis.com/Network4 create_time ( 2.google.protobuf.TimestampBA4 - update_time ( 2.google.protobuf.TimestampBA/ + update_time ( 2.google.protobuf.TimestampBA +uid ( BA/ MetadataEntry key (  value ( :8:A diff --git a/ServiceDirectory/metadata/V1Beta1/LookupService.php b/ServiceDirectory/metadata/V1Beta1/LookupService.php index 53a417388a9..b248278692a 100644 --- a/ServiceDirectory/metadata/V1Beta1/LookupService.php +++ b/ServiceDirectory/metadata/V1Beta1/LookupService.php @@ -15,14 +15,14 @@ public static function initOnce() { return; } \GPBMetadata\Google\Api\Annotations::initOnce(); + \GPBMetadata\Google\Api\Client::initOnce(); \GPBMetadata\Google\Api\FieldBehavior::initOnce(); \GPBMetadata\Google\Api\Resource::initOnce(); \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\Service::initOnce(); - \GPBMetadata\Google\Api\Client::initOnce(); $pool->internalAddGeneratedFile( '  -:google/cloud/servicedirectory/v1beta1/lookup_service.proto%google.cloud.servicedirectory.v1beta1google/api/field_behavior.protogoogle/api/resource.proto3google/cloud/servicedirectory/v1beta1/service.protogoogle/api/client.proto" +:google/cloud/servicedirectory/v1beta1/lookup_service.proto%google.cloud.servicedirectory.v1beta1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto3google/cloud/servicedirectory/v1beta1/service.proto" ResolveServiceRequest= name ( B/AA) \'servicedirectory.googleapis.com/Service diff --git a/ServiceDirectory/metadata/V1Beta1/PBNamespace.php b/ServiceDirectory/metadata/V1Beta1/PBNamespace.php index 6fa125d78b3..d4a4c295b0c 100644 --- a/ServiceDirectory/metadata/V1Beta1/PBNamespace.php +++ b/ServiceDirectory/metadata/V1Beta1/PBNamespace.php @@ -19,13 +19,14 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' - -5google/cloud/servicedirectory/v1beta1/namespace.proto%google.cloud.servicedirectory.v1beta1google/api/resource.protogoogle/protobuf/timestamp.proto" + +5google/cloud/servicedirectory/v1beta1/namespace.proto%google.cloud.servicedirectory.v1beta1google/api/resource.protogoogle/protobuf/timestamp.proto" Namespace name ( BAQ labels ( 2<.google.cloud.servicedirectory.v1beta1.Namespace.LabelsEntryBA4 create_time ( 2.google.protobuf.TimestampBA4 - update_time ( 2.google.protobuf.TimestampBA- + update_time ( 2.google.protobuf.TimestampBA +uid ( BA- LabelsEntry key (  value ( :8:nAk diff --git a/ServiceDirectory/metadata/V1Beta1/RegistrationService.php b/ServiceDirectory/metadata/V1Beta1/RegistrationService.php index 985a6a7a26c..3428c4a76f4 100644 --- a/ServiceDirectory/metadata/V1Beta1/RegistrationService.php +++ b/ServiceDirectory/metadata/V1Beta1/RegistrationService.php @@ -27,7 +27,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); $pool->internalAddGeneratedFile( ' -9 +; @google/cloud/servicedirectory/v1beta1/registration_service.proto%google.cloud.servicedirectory.v1beta1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto4google/cloud/servicedirectory/v1beta1/endpoint.proto5google/cloud/servicedirectory/v1beta1/namespace.proto3google/cloud/servicedirectory/v1beta1/service.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto" CreateNamespaceRequest9 parent ( B)AA# @@ -105,7 +105,7 @@ public static function initOnce() { update_mask ( 2.google.protobuf.FieldMaskBA"W DeleteEndpointRequest> name ( B0AA* -(servicedirectory.googleapis.com/Endpoint2 +(servicedirectory.googleapis.com/Endpoint2" RegistrationService CreateNamespace=.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest0.google.cloud.servicedirectory.v1beta1.Namespace"f@"3/v1beta1/{parent=projects/*/locations/*}/namespaces: namespaceAparent,namespace,namespace_id ListNamespaces<.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest=.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse"D53/v1beta1/{parent=projects/*/locations/*}/namespacesAparent @@ -122,10 +122,10 @@ public static function initOnce() { ListEndpoints;.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest<.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse"[LJ/v1beta1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpointsAparent GetEndpoint9.google.cloud.servicedirectory.v1beta1.GetEndpointRequest/.google.cloud.servicedirectory.v1beta1.Endpoint"YLJ/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}Aname UpdateEndpoint<.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest/.google.cloud.servicedirectory.v1beta1.Endpoint"|_2S/v1beta1/{endpoint.name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}:endpointAendpoint,update_mask -DeleteEndpoint<.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest.google.protobuf.Empty"YL*J/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}Aname - GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy""D/v1beta1/{resource=projects/*/locations/*/namespaces/*}:getIamPolicy:*ZT"O/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:getIamPolicy:* - SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy""D/v1beta1/{resource=projects/*/locations/*/namespaces/*}:setIamPolicy:*ZT"O/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:setIamPolicy:* -TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse""J/v1beta1/{resource=projects/*/locations/*/namespaces/*}:testIamPermissions:*ZZ"U/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions:*SAservicedirectory.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB +DeleteEndpoint<.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest.google.protobuf.Empty"YL*J/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}Aname + GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy""D/v1beta1/{resource=projects/*/locations/*/namespaces/*}:getIamPolicy:*ZT"O/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:getIamPolicy:*ZU"P/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:getIamPolicy:* + SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy""D/v1beta1/{resource=projects/*/locations/*/namespaces/*}:setIamPolicy:*ZT"O/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:setIamPolicy:*ZU"P/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:setIamPolicy:* +TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse""J/v1beta1/{resource=projects/*/locations/*/namespaces/*}:testIamPermissions:*ZZ"U/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions:*Z["V/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:testIamPermissions:*SAservicedirectory.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB )com.google.cloud.servicedirectory.v1beta1BRegistrationServiceProtoPZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb%Google.Cloud.ServiceDirectory.V1Beta1%Google\\Cloud\\ServiceDirectory\\V1beta1(Google::Cloud::ServiceDirectory::V1beta1bproto3' , true); diff --git a/ServiceDirectory/metadata/V1Beta1/Service.php b/ServiceDirectory/metadata/V1Beta1/Service.php index 8a9dbcccd3f..48ecd3cb74e 100644 --- a/ServiceDirectory/metadata/V1Beta1/Service.php +++ b/ServiceDirectory/metadata/V1Beta1/Service.php @@ -20,14 +20,15 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' - -3google/cloud/servicedirectory/v1beta1/service.proto%google.cloud.servicedirectory.v1beta1google/api/resource.proto4google/cloud/servicedirectory/v1beta1/endpoint.protogoogle/protobuf/timestamp.proto" + +3google/cloud/servicedirectory/v1beta1/service.proto%google.cloud.servicedirectory.v1beta1google/api/resource.proto4google/cloud/servicedirectory/v1beta1/endpoint.protogoogle/protobuf/timestamp.proto" Service name ( BAS metadata ( 2<.google.cloud.servicedirectory.v1beta1.Service.MetadataEntryBAG endpoints ( 2/.google.cloud.servicedirectory.v1beta1.EndpointBA4 create_time ( 2.google.protobuf.TimestampBA4 - update_time ( 2.google.protobuf.TimestampBA/ + update_time ( 2.google.protobuf.TimestampBA +uid ( BA/ MetadataEntry key (  value ( :8:A| diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/get_location.php b/ServiceDirectory/samples/V1/LookupServiceClient/get_location.php similarity index 100% rename from owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/get_location.php rename to ServiceDirectory/samples/V1/LookupServiceClient/get_location.php diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/list_locations.php b/ServiceDirectory/samples/V1/LookupServiceClient/list_locations.php similarity index 100% rename from owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/list_locations.php rename to ServiceDirectory/samples/V1/LookupServiceClient/list_locations.php diff --git a/ServiceDirectory/samples/V1/RegistrationServiceClient/create_endpoint.php b/ServiceDirectory/samples/V1/RegistrationServiceClient/create_endpoint.php index d9d8a1e3269..a35df2e906d 100644 --- a/ServiceDirectory/samples/V1/RegistrationServiceClient/create_endpoint.php +++ b/ServiceDirectory/samples/V1/RegistrationServiceClient/create_endpoint.php @@ -28,7 +28,7 @@ use Google\Cloud\ServiceDirectory\V1\RegistrationServiceClient; /** - * Creates a endpoint, and returns the new Endpoint. + * Creates an endpoint, and returns the new endpoint. * * @param string $formattedParent The resource name of the service that this endpoint provides. Please see * {@see RegistrationServiceClient::serviceName()} for help formatting this field. diff --git a/ServiceDirectory/samples/V1/RegistrationServiceClient/create_namespace.php b/ServiceDirectory/samples/V1/RegistrationServiceClient/create_namespace.php index ad12ddad6b9..ac0d2a0ab27 100644 --- a/ServiceDirectory/samples/V1/RegistrationServiceClient/create_namespace.php +++ b/ServiceDirectory/samples/V1/RegistrationServiceClient/create_namespace.php @@ -28,7 +28,7 @@ use Google\Cloud\ServiceDirectory\V1\RegistrationServiceClient; /** - * Creates a namespace, and returns the new Namespace. + * Creates a namespace, and returns the new namespace. * * @param string $formattedParent The resource name of the project and location the namespace * will be created in. Please see diff --git a/ServiceDirectory/samples/V1/RegistrationServiceClient/create_service.php b/ServiceDirectory/samples/V1/RegistrationServiceClient/create_service.php index a0eb71088ff..b69310084cf 100644 --- a/ServiceDirectory/samples/V1/RegistrationServiceClient/create_service.php +++ b/ServiceDirectory/samples/V1/RegistrationServiceClient/create_service.php @@ -28,7 +28,7 @@ use Google\Cloud\ServiceDirectory\V1\Service; /** - * Creates a service, and returns the new Service. + * Creates a service, and returns the new service. * * @param string $formattedParent The resource name of the namespace this service will belong to. Please see * {@see RegistrationServiceClient::namespaceName()} for help formatting this field. diff --git a/ServiceDirectory/samples/V1/RegistrationServiceClient/delete_endpoint.php b/ServiceDirectory/samples/V1/RegistrationServiceClient/delete_endpoint.php index 9fa4351dc27..7327696fe3f 100644 --- a/ServiceDirectory/samples/V1/RegistrationServiceClient/delete_endpoint.php +++ b/ServiceDirectory/samples/V1/RegistrationServiceClient/delete_endpoint.php @@ -27,7 +27,7 @@ use Google\Cloud\ServiceDirectory\V1\RegistrationServiceClient; /** - * Deletes a endpoint. + * Deletes an endpoint. * * @param string $formattedName The name of the endpoint to delete. Please see * {@see RegistrationServiceClient::endpointName()} for help formatting this field. diff --git a/ServiceDirectory/samples/V1/RegistrationServiceClient/get_endpoint.php b/ServiceDirectory/samples/V1/RegistrationServiceClient/get_endpoint.php index 6ceca21a53d..78a26970fdb 100644 --- a/ServiceDirectory/samples/V1/RegistrationServiceClient/get_endpoint.php +++ b/ServiceDirectory/samples/V1/RegistrationServiceClient/get_endpoint.php @@ -28,7 +28,7 @@ use Google\Cloud\ServiceDirectory\V1\RegistrationServiceClient; /** - * Gets a endpoint. + * Gets an endpoint. * * @param string $formattedName The name of the endpoint to get. Please see * {@see RegistrationServiceClient::endpointName()} for help formatting this field. diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_location.php b/ServiceDirectory/samples/V1/RegistrationServiceClient/get_location.php similarity index 100% rename from owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_location.php rename to ServiceDirectory/samples/V1/RegistrationServiceClient/get_location.php diff --git a/ServiceDirectory/samples/V1/RegistrationServiceClient/list_endpoints.php b/ServiceDirectory/samples/V1/RegistrationServiceClient/list_endpoints.php index b34ff7f9d65..b5800a4edb8 100644 --- a/ServiceDirectory/samples/V1/RegistrationServiceClient/list_endpoints.php +++ b/ServiceDirectory/samples/V1/RegistrationServiceClient/list_endpoints.php @@ -31,7 +31,7 @@ /** * Lists all endpoints. * - * @param string $formattedParent The resource name of the service whose endpoints we'd like to + * @param string $formattedParent The resource name of the service whose endpoints you'd like to * list. Please see * {@see RegistrationServiceClient::serviceName()} for help formatting this field. */ diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_locations.php b/ServiceDirectory/samples/V1/RegistrationServiceClient/list_locations.php similarity index 100% rename from owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_locations.php rename to ServiceDirectory/samples/V1/RegistrationServiceClient/list_locations.php diff --git a/ServiceDirectory/samples/V1/RegistrationServiceClient/list_namespaces.php b/ServiceDirectory/samples/V1/RegistrationServiceClient/list_namespaces.php index e354d63ad38..eb124ec2ecf 100644 --- a/ServiceDirectory/samples/V1/RegistrationServiceClient/list_namespaces.php +++ b/ServiceDirectory/samples/V1/RegistrationServiceClient/list_namespaces.php @@ -32,7 +32,7 @@ * Lists all namespaces. * * @param string $formattedParent The resource name of the project and location whose namespaces - * we'd like to list. Please see + * you'd like to list. Please see * {@see RegistrationServiceClient::locationName()} for help formatting this field. */ function list_namespaces_sample(string $formattedParent): void diff --git a/ServiceDirectory/samples/V1/RegistrationServiceClient/list_services.php b/ServiceDirectory/samples/V1/RegistrationServiceClient/list_services.php index b9036e22ace..ae5487d467f 100644 --- a/ServiceDirectory/samples/V1/RegistrationServiceClient/list_services.php +++ b/ServiceDirectory/samples/V1/RegistrationServiceClient/list_services.php @@ -31,7 +31,7 @@ /** * Lists all services belonging to a namespace. * - * @param string $formattedParent The resource name of the namespace whose services we'd + * @param string $formattedParent The resource name of the namespace whose services you'd * like to list. Please see * {@see RegistrationServiceClient::namespaceName()} for help formatting this field. */ diff --git a/ServiceDirectory/samples/V1/RegistrationServiceClient/update_endpoint.php b/ServiceDirectory/samples/V1/RegistrationServiceClient/update_endpoint.php index c9db78d5a8d..9160aa0875f 100644 --- a/ServiceDirectory/samples/V1/RegistrationServiceClient/update_endpoint.php +++ b/ServiceDirectory/samples/V1/RegistrationServiceClient/update_endpoint.php @@ -29,7 +29,7 @@ use Google\Protobuf\FieldMask; /** - * Updates a endpoint. + * Updates an endpoint. * * This sample has been automatically generated and should be regarded as a code * template only. It will require modifications to work: diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/get_location.php b/ServiceDirectory/samples/V1beta1/LookupServiceClient/get_location.php similarity index 100% rename from owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/get_location.php rename to ServiceDirectory/samples/V1beta1/LookupServiceClient/get_location.php diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/list_locations.php b/ServiceDirectory/samples/V1beta1/LookupServiceClient/list_locations.php similarity index 100% rename from owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/list_locations.php rename to ServiceDirectory/samples/V1beta1/LookupServiceClient/list_locations.php diff --git a/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/get_iam_policy.php b/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/get_iam_policy.php index 9e32ea230a8..e7e0fb7982b 100644 --- a/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/get_iam_policy.php +++ b/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/get_iam_policy.php @@ -28,7 +28,7 @@ use Google\Cloud\ServiceDirectory\V1beta1\RegistrationServiceClient; /** - * Gets the IAM Policy for a resource (namespace or service only). + * Gets the IAM Policy for a resource * * @param string $resource REQUIRED: The resource for which the policy is being requested. * See the operation documentation for the appropriate value for this field. diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_location.php b/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/get_location.php similarity index 100% rename from owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_location.php rename to ServiceDirectory/samples/V1beta1/RegistrationServiceClient/get_location.php diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_locations.php b/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/list_locations.php similarity index 100% rename from owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_locations.php rename to ServiceDirectory/samples/V1beta1/RegistrationServiceClient/list_locations.php diff --git a/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/list_namespaces.php b/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/list_namespaces.php index 4597ea60f53..ae18ff1d638 100644 --- a/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/list_namespaces.php +++ b/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/list_namespaces.php @@ -31,8 +31,8 @@ /** * Lists all namespaces. * - * @param string $formattedParent The resource name of the project and location whose namespaces you'd like - * to list. Please see + * @param string $formattedParent The resource name of the project and location whose namespaces + * you'd like to list. Please see * {@see RegistrationServiceClient::locationName()} for help formatting this field. */ function list_namespaces_sample(string $formattedParent): void diff --git a/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/set_iam_policy.php b/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/set_iam_policy.php index a8de280bd50..7087d6adec5 100644 --- a/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/set_iam_policy.php +++ b/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/set_iam_policy.php @@ -28,7 +28,7 @@ use Google\Cloud\ServiceDirectory\V1beta1\RegistrationServiceClient; /** - * Sets the IAM Policy for a resource (namespace or service only). + * Sets the IAM Policy for a resource * * @param string $resource REQUIRED: The resource for which the policy is being specified. * See the operation documentation for the appropriate value for this field. diff --git a/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/test_iam_permissions.php b/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/test_iam_permissions.php index 2e9f9f7f930..a2676b86686 100644 --- a/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/test_iam_permissions.php +++ b/ServiceDirectory/samples/V1beta1/RegistrationServiceClient/test_iam_permissions.php @@ -28,7 +28,8 @@ use Google\Cloud\ServiceDirectory\V1beta1\RegistrationServiceClient; /** - * Tests IAM permissions for a resource (namespace or service only). + * Tests IAM permissions for a resource (namespace, service or + * service workload only). * * @param string $resource REQUIRED: The resource for which the policy detail is being requested. * See the operation documentation for the appropriate value for this field. diff --git a/ServiceDirectory/src/V1/Client/BaseClient/LookupServiceBaseClient.php b/ServiceDirectory/src/V1/Client/BaseClient/LookupServiceBaseClient.php index 9390a53229a..12b15170c47 100644 --- a/ServiceDirectory/src/V1/Client/BaseClient/LookupServiceBaseClient.php +++ b/ServiceDirectory/src/V1/Client/BaseClient/LookupServiceBaseClient.php @@ -27,11 +27,15 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; +use Google\ApiCore\PagedListResponse; use Google\ApiCore\ResourceHelperTrait; use Google\ApiCore\RetrySettings; use Google\ApiCore\Transport\TransportInterface; use Google\ApiCore\ValidationException; use Google\Auth\FetchAuthTokenInterface; +use Google\Cloud\Location\GetLocationRequest; +use Google\Cloud\Location\ListLocationsRequest; +use Google\Cloud\Location\Location; use Google\Cloud\ServiceDirectory\V1\ResolveServiceRequest; use Google\Cloud\ServiceDirectory\V1\ResolveServiceResponse; use GuzzleHttp\Promise\PromiseInterface; @@ -56,6 +60,8 @@ * @internal * * @method PromiseInterface resolveServiceAsync(ResolveServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) */ abstract class LookupServiceBaseClient { @@ -239,4 +245,52 @@ public function resolveService(ResolveServiceRequest $request, array $callOption { return $this->startApiCall('ResolveService', $request, $callOptions)->wait(); } + + /** + * Gets information about a location. + * + * The async variant is {@see self::getLocationAsync()} . + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } } diff --git a/ServiceDirectory/src/V1/Client/BaseClient/RegistrationServiceBaseClient.php b/ServiceDirectory/src/V1/Client/BaseClient/RegistrationServiceBaseClient.php index 790be762d04..a5a368dd7bc 100644 --- a/ServiceDirectory/src/V1/Client/BaseClient/RegistrationServiceBaseClient.php +++ b/ServiceDirectory/src/V1/Client/BaseClient/RegistrationServiceBaseClient.php @@ -38,6 +38,9 @@ use Google\Cloud\Iam\V1\SetIamPolicyRequest; use Google\Cloud\Iam\V1\TestIamPermissionsRequest; use Google\Cloud\Iam\V1\TestIamPermissionsResponse; +use Google\Cloud\Location\GetLocationRequest; +use Google\Cloud\Location\ListLocationsRequest; +use Google\Cloud\Location\Location; use Google\Cloud\ServiceDirectory\V1\CreateEndpointRequest; use Google\Cloud\ServiceDirectory\V1\CreateNamespaceRequest; use Google\Cloud\ServiceDirectory\V1\CreateServiceRequest; @@ -109,6 +112,8 @@ * @method PromiseInterface updateEndpointAsync(UpdateEndpointRequest $request, array $optionalArgs = []) * @method PromiseInterface updateNamespaceAsync(UpdateNamespaceRequest $request, array $optionalArgs = []) * @method PromiseInterface updateServiceAsync(UpdateServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) */ abstract class RegistrationServiceBaseClient { @@ -210,6 +215,23 @@ public static function namespaceName(string $project, string $location, string $ ]); } + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $project + * @param string $network + * + * @return string The formatted network resource. + */ + public static function networkName(string $project, string $network): string + { + return self::getPathTemplate('network')->render([ + 'project' => $project, + 'network' => $network, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a service * resource. @@ -238,6 +260,7 @@ public static function serviceName(string $project, string $location, string $na * - endpoint: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint} * - location: projects/{project}/locations/{location} * - namespace: projects/{project}/locations/{location}/namespaces/{namespace} + * - network: projects/{project}/locations/global/networks/{network} * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} * * The optional $template argument can be supplied to specify a particular pattern, @@ -330,7 +353,7 @@ public function __call($method, $args) } /** - * Creates a endpoint, and returns the new Endpoint. + * Creates an endpoint, and returns the new endpoint. * * The async variant is {@see self::createEndpointAsync()} . * @@ -354,7 +377,7 @@ public function createEndpoint(CreateEndpointRequest $request, array $callOption } /** - * Creates a namespace, and returns the new Namespace. + * Creates a namespace, and returns the new namespace. * * The async variant is {@see self::createNamespaceAsync()} . * @@ -378,7 +401,7 @@ public function createNamespace(CreateNamespaceRequest $request, array $callOpti } /** - * Creates a service, and returns the new Service. + * Creates a service, and returns the new service. * * The async variant is {@see self::createServiceAsync()} . * @@ -402,7 +425,7 @@ public function createService(CreateServiceRequest $request, array $callOptions } /** - * Deletes a endpoint. + * Deletes an endpoint. * * The async variant is {@see self::deleteEndpointAsync()} . * @@ -470,7 +493,7 @@ public function deleteService(DeleteServiceRequest $request, array $callOptions } /** - * Gets a endpoint. + * Gets an endpoint. * * The async variant is {@see self::getEndpointAsync()} . * @@ -686,7 +709,7 @@ public function testIamPermissions(TestIamPermissionsRequest $request, array $ca } /** - * Updates a endpoint. + * Updates an endpoint. * * The async variant is {@see self::updateEndpointAsync()} . * @@ -756,4 +779,52 @@ public function updateService(UpdateServiceRequest $request, array $callOptions { return $this->startApiCall('UpdateService', $request, $callOptions)->wait(); } + + /** + * Gets information about a location. + * + * The async variant is {@see self::getLocationAsync()} . + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } } diff --git a/ServiceDirectory/src/V1/Endpoint.php b/ServiceDirectory/src/V1/Endpoint.php index c3199aaa7f0..8aae64a732f 100644 --- a/ServiceDirectory/src/V1/Endpoint.php +++ b/ServiceDirectory/src/V1/Endpoint.php @@ -25,49 +25,64 @@ class Endpoint extends \Google\Protobuf\Internal\Message */ private $name = ''; /** - * Optional. An IPv4 or IPv6 address. Service Directory will reject bad - * addresses like: - * "8.8.8" - * "8.8.8.8:53" - * "test:bad:address" - * "[::1]" - * "[::1]:8080" + * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + * like: + * * `8.8.8` + * * `8.8.8.8:53` + * * `test:bad:address` + * * `[::1]` + * * `[::1]:8080` * Limited to 45 characters. * * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OPTIONAL]; */ private $address = ''; /** - * Optional. Service Directory will reject values outside of [0, 65535]. + * Optional. Service Directory rejects values outside of `[0, 65535]`. * * Generated from protobuf field int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; */ private $port = 0; /** * Optional. Annotations for the endpoint. This data can be consumed by - * service clients. Restrictions: - * - The entire annotations dictionary may contain up to 512 characters, - * spread accoss all key-value pairs. Annotations that goes beyond any - * these limits will be rejected. - * - Valid annotation keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Annotations that fails to meet these requirements will be rejected. - * - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved - * for system annotations managed by Service Directory. If the user tries - * to write to these keyspaces, those entries will be silently ignored by - * the system. - * Note: This field is equivalent to the 'metadata' field in the v1beta1 API. + * service clients. + * Restrictions: + * * The entire annotations dictionary may contain up to 512 characters, + * spread accoss all key-value pairs. Annotations that go beyond this + * limit are rejected + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/) + * Annotations that fails to meet these requirements are rejected. + * Note: This field is equivalent to the `metadata` field in the v1beta1 API. * They have the same syntax and read/write to the same location in Service * Directory. * * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; */ private $annotations; + /** + * Immutable. The Google Compute Engine network (VPC) of the endpoint in the + * format `projects//locations/global/networks/*`. + * The project must be specified by project number (project id is rejected). + * Incorrectly formatted networks are rejected, we also check to make sure + * that you have the servicedirectory.networks.attach permission on the + * project specified. + * + * Generated from protobuf field string network = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + private $network = ''; + /** + * Output only. The globally unique identifier of the endpoint in the UUID4 + * format. + * + * Generated from protobuf field string uid = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $uid = ''; /** * Constructor. @@ -79,37 +94,44 @@ class Endpoint extends \Google\Protobuf\Internal\Message * Immutable. The resource name for the endpoint in the format * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. * @type string $address - * Optional. An IPv4 or IPv6 address. Service Directory will reject bad - * addresses like: - * "8.8.8" - * "8.8.8.8:53" - * "test:bad:address" - * "[::1]" - * "[::1]:8080" + * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + * like: + * * `8.8.8` + * * `8.8.8.8:53` + * * `test:bad:address` + * * `[::1]` + * * `[::1]:8080` * Limited to 45 characters. * @type int $port - * Optional. Service Directory will reject values outside of [0, 65535]. + * Optional. Service Directory rejects values outside of `[0, 65535]`. * @type array|\Google\Protobuf\Internal\MapField $annotations * Optional. Annotations for the endpoint. This data can be consumed by - * service clients. Restrictions: - * - The entire annotations dictionary may contain up to 512 characters, - * spread accoss all key-value pairs. Annotations that goes beyond any - * these limits will be rejected. - * - Valid annotation keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Annotations that fails to meet these requirements will be rejected. - * - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved - * for system annotations managed by Service Directory. If the user tries - * to write to these keyspaces, those entries will be silently ignored by - * the system. - * Note: This field is equivalent to the 'metadata' field in the v1beta1 API. + * service clients. + * Restrictions: + * * The entire annotations dictionary may contain up to 512 characters, + * spread accoss all key-value pairs. Annotations that go beyond this + * limit are rejected + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/) + * Annotations that fails to meet these requirements are rejected. + * Note: This field is equivalent to the `metadata` field in the v1beta1 API. * They have the same syntax and read/write to the same location in Service * Directory. + * @type string $network + * Immutable. The Google Compute Engine network (VPC) of the endpoint in the + * format `projects//locations/global/networks/*`. + * The project must be specified by project number (project id is rejected). + * Incorrectly formatted networks are rejected, we also check to make sure + * that you have the servicedirectory.networks.attach permission on the + * project specified. + * @type string $uid + * Output only. The globally unique identifier of the endpoint in the UUID4 + * format. * } */ public function __construct($data = NULL) { @@ -146,13 +168,13 @@ public function setName($var) } /** - * Optional. An IPv4 or IPv6 address. Service Directory will reject bad - * addresses like: - * "8.8.8" - * "8.8.8.8:53" - * "test:bad:address" - * "[::1]" - * "[::1]:8080" + * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + * like: + * * `8.8.8` + * * `8.8.8.8:53` + * * `test:bad:address` + * * `[::1]` + * * `[::1]:8080` * Limited to 45 characters. * * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -164,13 +186,13 @@ public function getAddress() } /** - * Optional. An IPv4 or IPv6 address. Service Directory will reject bad - * addresses like: - * "8.8.8" - * "8.8.8.8:53" - * "test:bad:address" - * "[::1]" - * "[::1]:8080" + * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + * like: + * * `8.8.8` + * * `8.8.8.8:53` + * * `test:bad:address` + * * `[::1]` + * * `[::1]:8080` * Limited to 45 characters. * * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -186,7 +208,7 @@ public function setAddress($var) } /** - * Optional. Service Directory will reject values outside of [0, 65535]. + * Optional. Service Directory rejects values outside of `[0, 65535]`. * * Generated from protobuf field int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -197,7 +219,7 @@ public function getPort() } /** - * Optional. Service Directory will reject values outside of [0, 65535]. + * Optional. Service Directory rejects values outside of `[0, 65535]`. * * Generated from protobuf field int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var @@ -213,23 +235,20 @@ public function setPort($var) /** * Optional. Annotations for the endpoint. This data can be consumed by - * service clients. Restrictions: - * - The entire annotations dictionary may contain up to 512 characters, - * spread accoss all key-value pairs. Annotations that goes beyond any - * these limits will be rejected. - * - Valid annotation keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Annotations that fails to meet these requirements will be rejected. - * - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved - * for system annotations managed by Service Directory. If the user tries - * to write to these keyspaces, those entries will be silently ignored by - * the system. - * Note: This field is equivalent to the 'metadata' field in the v1beta1 API. + * service clients. + * Restrictions: + * * The entire annotations dictionary may contain up to 512 characters, + * spread accoss all key-value pairs. Annotations that go beyond this + * limit are rejected + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/) + * Annotations that fails to meet these requirements are rejected. + * Note: This field is equivalent to the `metadata` field in the v1beta1 API. * They have the same syntax and read/write to the same location in Service * Directory. * @@ -243,23 +262,20 @@ public function getAnnotations() /** * Optional. Annotations for the endpoint. This data can be consumed by - * service clients. Restrictions: - * - The entire annotations dictionary may contain up to 512 characters, - * spread accoss all key-value pairs. Annotations that goes beyond any - * these limits will be rejected. - * - Valid annotation keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Annotations that fails to meet these requirements will be rejected. - * - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved - * for system annotations managed by Service Directory. If the user tries - * to write to these keyspaces, those entries will be silently ignored by - * the system. - * Note: This field is equivalent to the 'metadata' field in the v1beta1 API. + * service clients. + * Restrictions: + * * The entire annotations dictionary may contain up to 512 characters, + * spread accoss all key-value pairs. Annotations that go beyond this + * limit are rejected + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/) + * Annotations that fails to meet these requirements are rejected. + * Note: This field is equivalent to the `metadata` field in the v1beta1 API. * They have the same syntax and read/write to the same location in Service * Directory. * @@ -275,5 +291,69 @@ public function setAnnotations($var) return $this; } + /** + * Immutable. The Google Compute Engine network (VPC) of the endpoint in the + * format `projects//locations/global/networks/*`. + * The project must be specified by project number (project id is rejected). + * Incorrectly formatted networks are rejected, we also check to make sure + * that you have the servicedirectory.networks.attach permission on the + * project specified. + * + * Generated from protobuf field string network = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Immutable. The Google Compute Engine network (VPC) of the endpoint in the + * format `projects//locations/global/networks/*`. + * The project must be specified by project number (project id is rejected). + * Incorrectly formatted networks are rejected, we also check to make sure + * that you have the servicedirectory.networks.attach permission on the + * project specified. + * + * Generated from protobuf field string network = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Output only. The globally unique identifier of the endpoint in the UUID4 + * format. + * + * Generated from protobuf field string uid = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. The globally unique identifier of the endpoint in the UUID4 + * format. + * + * Generated from protobuf field string uid = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + } diff --git a/ServiceDirectory/src/V1/Gapic/LookupServiceGapicClient.php b/ServiceDirectory/src/V1/Gapic/LookupServiceGapicClient.php index 7ec2aa938dd..d46977e3129 100644 --- a/ServiceDirectory/src/V1/Gapic/LookupServiceGapicClient.php +++ b/ServiceDirectory/src/V1/Gapic/LookupServiceGapicClient.php @@ -25,6 +25,7 @@ namespace Google\Cloud\ServiceDirectory\V1\Gapic; use Google\ApiCore\ApiException; +use Google\ApiCore\Call; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; use Google\ApiCore\PathTemplate; @@ -33,6 +34,10 @@ use Google\ApiCore\Transport\TransportInterface; use Google\ApiCore\ValidationException; use Google\Auth\FetchAuthTokenInterface; +use Google\Cloud\Location\GetLocationRequest; +use Google\Cloud\Location\ListLocationsRequest; +use Google\Cloud\Location\ListLocationsResponse; +use Google\Cloud\Location\Location; use Google\Cloud\ServiceDirectory\V1\ResolveServiceRequest; use Google\Cloud\ServiceDirectory\V1\ResolveServiceResponse; @@ -290,22 +295,40 @@ public function __construct(array $options = []) * @type string $endpointFilter * Optional. The filter applied to the endpoints of the resolved service. * - * General filter string syntax: - * () - * can be "name" or "metadata." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is - * roughly the same as "=". - * must be the same data type as the field. - * can be "AND, OR, NOT". + * General `filter` string syntax: + * ` ()` + * + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * * Examples of valid filters: - * * "metadata.owner" returns Endpoints that have a label with the - * key "owner", this is the same as "metadata:owner" - * * "metadata.protocol=gRPC" returns Endpoints that have key/value - * "protocol=gRPC" - * * "metadata.owner!=sd AND metadata.foo=bar" returns - * Endpoints that have "owner" field in metadata with a value that is not - * "sd" AND have the key/value foo=bar. + * + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoint, it returns no results + * + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -343,4 +366,144 @@ public function resolveService($name, array $optionalArgs = []) $request )->wait(); } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $lookupServiceClient = new LookupServiceClient(); + * try { + * $response = $lookupServiceClient->getLocation(); + * } finally { + * $lookupServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'GetLocation', + Location::class, + $optionalArgs, + $request, + Call::UNARY_CALL, + 'google.cloud.location.Locations' + )->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $lookupServiceClient = new LookupServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $lookupServiceClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $lookupServiceClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $lookupServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->getPagedListResponse( + 'ListLocations', + $optionalArgs, + ListLocationsResponse::class, + $request, + 'google.cloud.location.Locations' + ); + } } diff --git a/ServiceDirectory/src/V1/Gapic/RegistrationServiceGapicClient.php b/ServiceDirectory/src/V1/Gapic/RegistrationServiceGapicClient.php index ffa7399e2e5..a52740a8899 100644 --- a/ServiceDirectory/src/V1/Gapic/RegistrationServiceGapicClient.php +++ b/ServiceDirectory/src/V1/Gapic/RegistrationServiceGapicClient.php @@ -25,6 +25,7 @@ namespace Google\Cloud\ServiceDirectory\V1\Gapic; use Google\ApiCore\ApiException; +use Google\ApiCore\Call; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; use Google\ApiCore\PathTemplate; @@ -39,6 +40,10 @@ use Google\Cloud\Iam\V1\SetIamPolicyRequest; use Google\Cloud\Iam\V1\TestIamPermissionsRequest; use Google\Cloud\Iam\V1\TestIamPermissionsResponse; +use Google\Cloud\Location\GetLocationRequest; +use Google\Cloud\Location\ListLocationsRequest; +use Google\Cloud\Location\ListLocationsResponse; +use Google\Cloud\Location\Location; use Google\Cloud\ServiceDirectory\V1\CreateEndpointRequest; use Google\Cloud\ServiceDirectory\V1\CreateNamespaceRequest; use Google\Cloud\ServiceDirectory\V1\CreateServiceRequest; @@ -131,6 +136,8 @@ class RegistrationServiceGapicClient private static $namespaceNameTemplate; + private static $networkNameTemplate; + private static $serviceNameTemplate; private static $pathTemplateMap; @@ -195,6 +202,17 @@ private static function getNamespaceNameTemplate() return self::$namespaceNameTemplate; } + private static function getNetworkNameTemplate() + { + if (self::$networkNameTemplate == null) { + self::$networkNameTemplate = new PathTemplate( + 'projects/{project}/locations/global/networks/{network}' + ); + } + + return self::$networkNameTemplate; + } + private static function getServiceNameTemplate() { if (self::$serviceNameTemplate == null) { @@ -213,6 +231,7 @@ private static function getPathTemplateMap() 'endpoint' => self::getEndpointNameTemplate(), 'location' => self::getLocationNameTemplate(), 'namespace' => self::getNamespaceNameTemplate(), + 'network' => self::getNetworkNameTemplate(), 'service' => self::getServiceNameTemplate(), ]; } @@ -284,6 +303,23 @@ public static function namespaceName($project, $location, $namespace) ]); } + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $project + * @param string $network + * + * @return string The formatted network resource. + */ + public static function networkName($project, $network) + { + return self::getNetworkNameTemplate()->render([ + 'project' => $project, + 'network' => $network, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a service * resource. @@ -316,6 +352,7 @@ public static function serviceName( * - endpoint: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint} * - location: projects/{project}/locations/{location} * - namespace: projects/{project}/locations/{location}/namespaces/{namespace} + * - network: projects/{project}/locations/global/networks/{network} * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} * * The optional $template argument can be supplied to specify a particular pattern, @@ -418,7 +455,7 @@ public function __construct(array $options = []) } /** - * Creates a endpoint, and returns the new Endpoint. + * Creates an endpoint, and returns the new endpoint. * * Sample code: * ``` @@ -482,7 +519,7 @@ public function createEndpoint( } /** - * Creates a namespace, and returns the new Namespace. + * Creates a namespace, and returns the new namespace. * * Sample code: * ``` @@ -547,7 +584,7 @@ public function createNamespace( } /** - * Creates a service, and returns the new Service. + * Creates a service, and returns the new service. * * Sample code: * ``` @@ -611,7 +648,7 @@ public function createService( } /** - * Deletes a endpoint. + * Deletes an endpoint. * * Sample code: * ``` @@ -751,7 +788,7 @@ public function deleteService($name, array $optionalArgs = []) } /** - * Gets a endpoint. + * Gets an endpoint. * * Sample code: * ``` @@ -976,7 +1013,7 @@ public function getService($name, array $optionalArgs = []) * } * ``` * - * @param string $parent Required. The resource name of the service whose endpoints we'd like to + * @param string $parent Required. The resource name of the service whose endpoints you'd like to * list. * @param array $optionalArgs { * Optional. @@ -991,33 +1028,50 @@ public function getService($name, array $optionalArgs = []) * of values will be returned. Any page token used here must have * been generated by a previous call to the API. * @type string $filter - * Optional. The filter to list result by. + * Optional. The filter to list results by. * - * General filter string syntax: - * () - * can be "name", "address", "port" or "metadata." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and - * is roughly the same as "=". - * must be the same data type as field. - * can be "AND, OR, NOT". + * General `filter` string syntax: + * ` ()` + * + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * * Examples of valid filters: - * * "metadata.owner" returns Endpoints that have a label with the key "owner" - * this is the same as "metadata:owner". - * * "metadata.protocol=gRPC" returns Endpoints that have key/value - * "protocol=gRPC". - * * "address=192.108.1.105" returns Endpoints that have this address. - * * "port>8080" returns Endpoints that have port number larger than 8080. - * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c" - * returns Endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" will be returned but "endpoint-a" will not be. - * * "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have - * "owner" in label key but value is not "sd" AND have key/value foo=bar. - * * "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't - * have a field called "doesnotexist". Since the filter does not match any - * Endpoints, it returns no results. + * + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoints, it returns no results + * + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * @type string $orderBy - * Optional. The order to list result by. + * Optional. The order to list results by. + * + * General `order_by` string syntax: ` () (,)` + * + * * `` allows values: `name`, `address`, `port` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -1091,7 +1145,7 @@ public function listEndpoints($parent, array $optionalArgs = []) * ``` * * @param string $parent Required. The resource name of the project and location whose namespaces - * we'd like to list. + * you'd like to list. * @param array $optionalArgs { * Optional. * @@ -1105,39 +1159,45 @@ public function listEndpoints($parent, array $optionalArgs = []) * of values will be returned. Any page token used here must have * been generated by a previous call to the API. * @type string $filter - * Optional. The filter to list result by. + * Optional. The filter to list results by. * - * General filter string syntax: - * () - * can be "name", or "labels." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and - * is roughly the same as "=". - * must be the same data type as field. - * can be "AND, OR, NOT". + * General `filter` string syntax: + * ` ()` + * + * * `` can be `name` or `labels.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * * Examples of valid filters: - * * "labels.owner" returns Namespaces that have a label with the key "owner" - * this is the same as "labels:owner". - * * "labels.protocol=gRPC" returns Namespaces that have key/value - * "protocol=gRPC". - * * "name>projects/my-project/locations/us-east/namespaces/namespace-c" - * returns Namespaces that have name that is alphabetically later than the - * string, so "namespace-e" will be returned but "namespace-a" will not be. - * * "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have - * "owner" in label key but value is not "sd" AND have key/value foo=bar. - * * "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't - * have a field called "doesnotexist". Since the filter does not match any - * Namespaces, it returns no results. + * + * * `labels.owner` returns namespaces that have a label with the key + * `owner`, this is the same as `labels:owner` + * * `labels.owner=sd` returns namespaces that have key/value + * `owner=sd` + * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + * returns namespaces that have name that is alphabetically later than the + * string, so "namespace-e" is returned but "namespace-a" is not + * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + * `owner` in label key but value is not `sd` AND have key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that namespace + * doesn't have a field called "doesnotexist". Since the filter does not + * match any namespaces, it returns no results + * + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * @type string $orderBy - * Optional. The order to list result by. - * - * General order by string syntax: - * () (,) - * allows values {"name"} - * ascending or descending order by . If this is left - * blank, "asc" is used. - * Note that an empty order_by string result in default order, which is order - * by name in ascending order. + * Optional. The order to list results by. + * + * General `order_by` string syntax: ` () (,)` + * + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -1210,7 +1270,7 @@ public function listNamespaces($parent, array $optionalArgs = []) * } * ``` * - * @param string $parent Required. The resource name of the namespace whose services we'd + * @param string $parent Required. The resource name of the namespace whose services you'd * like to list. * @param array $optionalArgs { * Optional. @@ -1225,31 +1285,47 @@ public function listNamespaces($parent, array $optionalArgs = []) * of values will be returned. Any page token used here must have * been generated by a previous call to the API. * @type string $filter - * Optional. The filter to list result by. + * Optional. The filter to list results by. + * + * General `filter` string syntax: + * ` ()` * - * General filter string syntax: - * () - * can be "name", or "metadata." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and - * is roughly the same as "=". - * must be the same data type as field. - * can be "AND, OR, NOT". + * * `` can be `name` or `annotations.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * * Examples of valid filters: - * * "metadata.owner" returns Services that have a label with the key "owner" - * this is the same as "metadata:owner". - * * "metadata.protocol=gRPC" returns Services that have key/value - * "protocol=gRPC". - * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c" - * returns Services that have name that is alphabetically later than the - * string, so "service-e" will be returned but "service-a" will not be. - * * "metadata.owner!=sd AND metadata.foo=bar" returns Services that have - * "owner" in label key but value is not "sd" AND have key/value foo=bar. - * * "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't - * have a field called "doesnotexist". Since the filter does not match any - * Services, it returns no results. + * + * * `annotations.owner` returns services that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns services that have key/value + * `protocol=gRPC` + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + * returns services that have name that is alphabetically later than the + * string, so "service-e" is returned but "service-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns services that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that service + * doesn't have a field called "doesnotexist". Since the filter does not + * match any services, it returns no results + * + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * @type string $orderBy - * Optional. The order to list result by. + * Optional. The order to list results by. + * + * General `order_by` string syntax: ` () (,)` + * + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -1420,7 +1496,7 @@ public function testIamPermissions( } /** - * Updates a endpoint. + * Updates an endpoint. * * Sample code: * ``` @@ -1580,4 +1656,144 @@ public function updateService( $request )->wait(); } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $response = $registrationServiceClient->getLocation(); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'GetLocation', + Location::class, + $optionalArgs, + $request, + Call::UNARY_CALL, + 'google.cloud.location.Locations' + )->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $registrationServiceClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $registrationServiceClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->getPagedListResponse( + 'ListLocations', + $optionalArgs, + ListLocationsResponse::class, + $request, + 'google.cloud.location.Locations' + ); + } } diff --git a/ServiceDirectory/src/V1/GetServiceRequest.php b/ServiceDirectory/src/V1/GetServiceRequest.php index d0435b68749..c76d43f1522 100644 --- a/ServiceDirectory/src/V1/GetServiceRequest.php +++ b/ServiceDirectory/src/V1/GetServiceRequest.php @@ -11,8 +11,8 @@ /** * The request message for * [RegistrationService.GetService][google.cloud.servicedirectory.v1.RegistrationService.GetService]. - * This should not be used for looking up a service. Insead, use the `resolve` - * method as it will contain all endpoints and associated metadata. + * This should not be used for looking up a service. Instead, use the `resolve` + * method as it contains all endpoints and associated annotations. * * Generated from protobuf message google.cloud.servicedirectory.v1.GetServiceRequest */ diff --git a/ServiceDirectory/src/V1/ListEndpointsRequest.php b/ServiceDirectory/src/V1/ListEndpointsRequest.php index 7c3c6c1848b..cf70d0abeec 100644 --- a/ServiceDirectory/src/V1/ListEndpointsRequest.php +++ b/ServiceDirectory/src/V1/ListEndpointsRequest.php @@ -17,7 +17,7 @@ class ListEndpointsRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The resource name of the service whose endpoints we'd like to + * Required. The resource name of the service whose endpoints you'd like to * list. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -37,42 +37,53 @@ class ListEndpointsRequest extends \Google\Protobuf\Internal\Message */ private $page_token = ''; /** - * Optional. The filter to list result by. - * General filter string syntax: - * () - * can be "name", "address", "port" or "metadata." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and - * is roughly the same as "=". - * must be the same data type as field. - * can be "AND, OR, NOT". + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * Examples of valid filters: - * * "metadata.owner" returns Endpoints that have a label with the key "owner" - * this is the same as "metadata:owner". - * * "metadata.protocol=gRPC" returns Endpoints that have key/value - * "protocol=gRPC". - * * "address=192.108.1.105" returns Endpoints that have this address. - * * "port>8080" returns Endpoints that have port number larger than 8080. - * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c" - * returns Endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" will be returned but "endpoint-a" will not be. - * * "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have - * "owner" in label key but value is not "sd" AND have key/value foo=bar. - * * "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't - * have a field called "doesnotexist". Since the filter does not match any - * Endpoints, it returns no results. + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoints, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ private $filter = ''; /** - * Optional. The order to list result by. + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows values: `name`, `address`, `port` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ private $order_by = ''; /** - * @param string $parent Required. The resource name of the service whose endpoints we'd like to + * @param string $parent Required. The resource name of the service whose endpoints you'd like to * list. Please see * {@see RegistrationServiceClient::serviceName()} for help formatting this field. * @@ -93,7 +104,7 @@ public static function build(string $parent): self * Optional. Data for populating the Message object. * * @type string $parent - * Required. The resource name of the service whose endpoints we'd like to + * Required. The resource name of the service whose endpoints you'd like to * list. * @type int $page_size * Optional. The maximum number of items to return. @@ -101,31 +112,42 @@ public static function build(string $parent): self * Optional. The next_page_token value returned from a previous List request, * if any. * @type string $filter - * Optional. The filter to list result by. - * General filter string syntax: - * () - * can be "name", "address", "port" or "metadata." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and - * is roughly the same as "=". - * must be the same data type as field. - * can be "AND, OR, NOT". + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * Examples of valid filters: - * * "metadata.owner" returns Endpoints that have a label with the key "owner" - * this is the same as "metadata:owner". - * * "metadata.protocol=gRPC" returns Endpoints that have key/value - * "protocol=gRPC". - * * "address=192.108.1.105" returns Endpoints that have this address. - * * "port>8080" returns Endpoints that have port number larger than 8080. - * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c" - * returns Endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" will be returned but "endpoint-a" will not be. - * * "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have - * "owner" in label key but value is not "sd" AND have key/value foo=bar. - * * "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't - * have a field called "doesnotexist". Since the filter does not match any - * Endpoints, it returns no results. + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoints, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * @type string $order_by - * Optional. The order to list result by. + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows values: `name`, `address`, `port` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. * } */ public function __construct($data = NULL) { @@ -134,7 +156,7 @@ public function __construct($data = NULL) { } /** - * Required. The resource name of the service whose endpoints we'd like to + * Required. The resource name of the service whose endpoints you'd like to * list. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -146,7 +168,7 @@ public function getParent() } /** - * Required. The resource name of the service whose endpoints we'd like to + * Required. The resource name of the service whose endpoints you'd like to * list. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -216,29 +238,34 @@ public function setPageToken($var) } /** - * Optional. The filter to list result by. - * General filter string syntax: - * () - * can be "name", "address", "port" or "metadata." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and - * is roughly the same as "=". - * must be the same data type as field. - * can be "AND, OR, NOT". + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * Examples of valid filters: - * * "metadata.owner" returns Endpoints that have a label with the key "owner" - * this is the same as "metadata:owner". - * * "metadata.protocol=gRPC" returns Endpoints that have key/value - * "protocol=gRPC". - * * "address=192.108.1.105" returns Endpoints that have this address. - * * "port>8080" returns Endpoints that have port number larger than 8080. - * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c" - * returns Endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" will be returned but "endpoint-a" will not be. - * * "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have - * "owner" in label key but value is not "sd" AND have key/value foo=bar. - * * "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't - * have a field called "doesnotexist". Since the filter does not match any - * Endpoints, it returns no results. + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoints, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -249,29 +276,34 @@ public function getFilter() } /** - * Optional. The filter to list result by. - * General filter string syntax: - * () - * can be "name", "address", "port" or "metadata." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and - * is roughly the same as "=". - * must be the same data type as field. - * can be "AND, OR, NOT". + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * Examples of valid filters: - * * "metadata.owner" returns Endpoints that have a label with the key "owner" - * this is the same as "metadata:owner". - * * "metadata.protocol=gRPC" returns Endpoints that have key/value - * "protocol=gRPC". - * * "address=192.108.1.105" returns Endpoints that have this address. - * * "port>8080" returns Endpoints that have port number larger than 8080. - * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c" - * returns Endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" will be returned but "endpoint-a" will not be. - * * "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have - * "owner" in label key but value is not "sd" AND have key/value foo=bar. - * * "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't - * have a field called "doesnotexist". Since the filter does not match any - * Endpoints, it returns no results. + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoints, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var @@ -286,7 +318,13 @@ public function setFilter($var) } /** - * Optional. The order to list result by. + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows values: `name`, `address`, `port` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -297,7 +335,13 @@ public function getOrderBy() } /** - * Optional. The order to list result by. + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows values: `name`, `address`, `port` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/ServiceDirectory/src/V1/ListNamespacesRequest.php b/ServiceDirectory/src/V1/ListNamespacesRequest.php index e22ef3e0878..62a0303bb84 100644 --- a/ServiceDirectory/src/V1/ListNamespacesRequest.php +++ b/ServiceDirectory/src/V1/ListNamespacesRequest.php @@ -18,7 +18,7 @@ class ListNamespacesRequest extends \Google\Protobuf\Internal\Message { /** * Required. The resource name of the project and location whose namespaces - * we'd like to list. + * you'd like to list. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -37,40 +37,41 @@ class ListNamespacesRequest extends \Google\Protobuf\Internal\Message */ private $page_token = ''; /** - * Optional. The filter to list result by. - * General filter string syntax: - * () - * can be "name", or "labels." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and - * is roughly the same as "=". - * must be the same data type as field. - * can be "AND, OR, NOT". + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `labels.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * Examples of valid filters: - * * "labels.owner" returns Namespaces that have a label with the key "owner" - * this is the same as "labels:owner". - * * "labels.protocol=gRPC" returns Namespaces that have key/value - * "protocol=gRPC". - * * "name>projects/my-project/locations/us-east/namespaces/namespace-c" - * returns Namespaces that have name that is alphabetically later than the - * string, so "namespace-e" will be returned but "namespace-a" will not be. - * * "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have - * "owner" in label key but value is not "sd" AND have key/value foo=bar. - * * "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't - * have a field called "doesnotexist". Since the filter does not match any - * Namespaces, it returns no results. + * * `labels.owner` returns namespaces that have a label with the key + * `owner`, this is the same as `labels:owner` + * * `labels.owner=sd` returns namespaces that have key/value + * `owner=sd` + * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + * returns namespaces that have name that is alphabetically later than the + * string, so "namespace-e" is returned but "namespace-a" is not + * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + * `owner` in label key but value is not `sd` AND have key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that namespace + * doesn't have a field called "doesnotexist". Since the filter does not + * match any namespaces, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ private $filter = ''; /** - * Optional. The order to list result by. - * General order by string syntax: - * () (,) - * allows values {"name"} - * ascending or descending order by . If this is left - * blank, "asc" is used. - * Note that an empty order_by string result in default order, which is order - * by name in ascending order. + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -78,7 +79,7 @@ class ListNamespacesRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The resource name of the project and location whose namespaces - * we'd like to list. Please see + * you'd like to list. Please see * {@see RegistrationServiceClient::locationName()} for help formatting this field. * * @return \Google\Cloud\ServiceDirectory\V1\ListNamespacesRequest @@ -99,43 +100,44 @@ public static function build(string $parent): self * * @type string $parent * Required. The resource name of the project and location whose namespaces - * we'd like to list. + * you'd like to list. * @type int $page_size * Optional. The maximum number of items to return. * @type string $page_token * Optional. The next_page_token value returned from a previous List request, * if any. * @type string $filter - * Optional. The filter to list result by. - * General filter string syntax: - * () - * can be "name", or "labels." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and - * is roughly the same as "=". - * must be the same data type as field. - * can be "AND, OR, NOT". + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `labels.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * Examples of valid filters: - * * "labels.owner" returns Namespaces that have a label with the key "owner" - * this is the same as "labels:owner". - * * "labels.protocol=gRPC" returns Namespaces that have key/value - * "protocol=gRPC". - * * "name>projects/my-project/locations/us-east/namespaces/namespace-c" - * returns Namespaces that have name that is alphabetically later than the - * string, so "namespace-e" will be returned but "namespace-a" will not be. - * * "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have - * "owner" in label key but value is not "sd" AND have key/value foo=bar. - * * "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't - * have a field called "doesnotexist". Since the filter does not match any - * Namespaces, it returns no results. + * * `labels.owner` returns namespaces that have a label with the key + * `owner`, this is the same as `labels:owner` + * * `labels.owner=sd` returns namespaces that have key/value + * `owner=sd` + * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + * returns namespaces that have name that is alphabetically later than the + * string, so "namespace-e" is returned but "namespace-a" is not + * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + * `owner` in label key but value is not `sd` AND have key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that namespace + * doesn't have a field called "doesnotexist". Since the filter does not + * match any namespaces, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * @type string $order_by - * Optional. The order to list result by. - * General order by string syntax: - * () (,) - * allows values {"name"} - * ascending or descending order by . If this is left - * blank, "asc" is used. - * Note that an empty order_by string result in default order, which is order - * by name in ascending order. + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. * } */ public function __construct($data = NULL) { @@ -145,7 +147,7 @@ public function __construct($data = NULL) { /** * Required. The resource name of the project and location whose namespaces - * we'd like to list. + * you'd like to list. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -157,7 +159,7 @@ public function getParent() /** * Required. The resource name of the project and location whose namespaces - * we'd like to list. + * you'd like to list. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var @@ -226,27 +228,29 @@ public function setPageToken($var) } /** - * Optional. The filter to list result by. - * General filter string syntax: - * () - * can be "name", or "labels." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and - * is roughly the same as "=". - * must be the same data type as field. - * can be "AND, OR, NOT". + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `labels.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * Examples of valid filters: - * * "labels.owner" returns Namespaces that have a label with the key "owner" - * this is the same as "labels:owner". - * * "labels.protocol=gRPC" returns Namespaces that have key/value - * "protocol=gRPC". - * * "name>projects/my-project/locations/us-east/namespaces/namespace-c" - * returns Namespaces that have name that is alphabetically later than the - * string, so "namespace-e" will be returned but "namespace-a" will not be. - * * "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have - * "owner" in label key but value is not "sd" AND have key/value foo=bar. - * * "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't - * have a field called "doesnotexist". Since the filter does not match any - * Namespaces, it returns no results. + * * `labels.owner` returns namespaces that have a label with the key + * `owner`, this is the same as `labels:owner` + * * `labels.owner=sd` returns namespaces that have key/value + * `owner=sd` + * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + * returns namespaces that have name that is alphabetically later than the + * string, so "namespace-e" is returned but "namespace-a" is not + * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + * `owner` in label key but value is not `sd` AND have key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that namespace + * doesn't have a field called "doesnotexist". Since the filter does not + * match any namespaces, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -257,27 +261,29 @@ public function getFilter() } /** - * Optional. The filter to list result by. - * General filter string syntax: - * () - * can be "name", or "labels." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and - * is roughly the same as "=". - * must be the same data type as field. - * can be "AND, OR, NOT". + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `labels.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * Examples of valid filters: - * * "labels.owner" returns Namespaces that have a label with the key "owner" - * this is the same as "labels:owner". - * * "labels.protocol=gRPC" returns Namespaces that have key/value - * "protocol=gRPC". - * * "name>projects/my-project/locations/us-east/namespaces/namespace-c" - * returns Namespaces that have name that is alphabetically later than the - * string, so "namespace-e" will be returned but "namespace-a" will not be. - * * "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have - * "owner" in label key but value is not "sd" AND have key/value foo=bar. - * * "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't - * have a field called "doesnotexist". Since the filter does not match any - * Namespaces, it returns no results. + * * `labels.owner` returns namespaces that have a label with the key + * `owner`, this is the same as `labels:owner` + * * `labels.owner=sd` returns namespaces that have key/value + * `owner=sd` + * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + * returns namespaces that have name that is alphabetically later than the + * string, so "namespace-e" is returned but "namespace-a" is not + * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + * `owner` in label key but value is not `sd` AND have key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that namespace + * doesn't have a field called "doesnotexist". Since the filter does not + * match any namespaces, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var @@ -292,14 +298,13 @@ public function setFilter($var) } /** - * Optional. The order to list result by. - * General order by string syntax: - * () (,) - * allows values {"name"} - * ascending or descending order by . If this is left - * blank, "asc" is used. - * Note that an empty order_by string result in default order, which is order - * by name in ascending order. + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -310,14 +315,13 @@ public function getOrderBy() } /** - * Optional. The order to list result by. - * General order by string syntax: - * () (,) - * allows values {"name"} - * ascending or descending order by . If this is left - * blank, "asc" is used. - * Note that an empty order_by string result in default order, which is order - * by name in ascending order. + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/ServiceDirectory/src/V1/ListServicesRequest.php b/ServiceDirectory/src/V1/ListServicesRequest.php index e172c8a842f..c515639fe4e 100644 --- a/ServiceDirectory/src/V1/ListServicesRequest.php +++ b/ServiceDirectory/src/V1/ListServicesRequest.php @@ -17,7 +17,7 @@ class ListServicesRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The resource name of the namespace whose services we'd + * Required. The resource name of the namespace whose services you'd * like to list. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -37,40 +37,50 @@ class ListServicesRequest extends \Google\Protobuf\Internal\Message */ private $page_token = ''; /** - * Optional. The filter to list result by. - * General filter string syntax: - * () - * can be "name", or "metadata." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and - * is roughly the same as "=". - * must be the same data type as field. - * can be "AND, OR, NOT". + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `annotations.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * Examples of valid filters: - * * "metadata.owner" returns Services that have a label with the key "owner" - * this is the same as "metadata:owner". - * * "metadata.protocol=gRPC" returns Services that have key/value - * "protocol=gRPC". - * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c" - * returns Services that have name that is alphabetically later than the - * string, so "service-e" will be returned but "service-a" will not be. - * * "metadata.owner!=sd AND metadata.foo=bar" returns Services that have - * "owner" in label key but value is not "sd" AND have key/value foo=bar. - * * "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't - * have a field called "doesnotexist". Since the filter does not match any - * Services, it returns no results. + * * `annotations.owner` returns services that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns services that have key/value + * `protocol=gRPC` + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + * returns services that have name that is alphabetically later than the + * string, so "service-e" is returned but "service-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns services that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that service + * doesn't have a field called "doesnotexist". Since the filter does not + * match any services, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ private $filter = ''; /** - * Optional. The order to list result by. + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ private $order_by = ''; /** - * @param string $parent Required. The resource name of the namespace whose services we'd + * @param string $parent Required. The resource name of the namespace whose services you'd * like to list. Please see * {@see RegistrationServiceClient::namespaceName()} for help formatting this field. * @@ -91,7 +101,7 @@ public static function build(string $parent): self * Optional. Data for populating the Message object. * * @type string $parent - * Required. The resource name of the namespace whose services we'd + * Required. The resource name of the namespace whose services you'd * like to list. * @type int $page_size * Optional. The maximum number of items to return. @@ -99,29 +109,39 @@ public static function build(string $parent): self * Optional. The next_page_token value returned from a previous List request, * if any. * @type string $filter - * Optional. The filter to list result by. - * General filter string syntax: - * () - * can be "name", or "metadata." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and - * is roughly the same as "=". - * must be the same data type as field. - * can be "AND, OR, NOT". + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `annotations.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * Examples of valid filters: - * * "metadata.owner" returns Services that have a label with the key "owner" - * this is the same as "metadata:owner". - * * "metadata.protocol=gRPC" returns Services that have key/value - * "protocol=gRPC". - * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c" - * returns Services that have name that is alphabetically later than the - * string, so "service-e" will be returned but "service-a" will not be. - * * "metadata.owner!=sd AND metadata.foo=bar" returns Services that have - * "owner" in label key but value is not "sd" AND have key/value foo=bar. - * * "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't - * have a field called "doesnotexist". Since the filter does not match any - * Services, it returns no results. + * * `annotations.owner` returns services that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns services that have key/value + * `protocol=gRPC` + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + * returns services that have name that is alphabetically later than the + * string, so "service-e" is returned but "service-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns services that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that service + * doesn't have a field called "doesnotexist". Since the filter does not + * match any services, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * @type string $order_by - * Optional. The order to list result by. + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. * } */ public function __construct($data = NULL) { @@ -130,7 +150,7 @@ public function __construct($data = NULL) { } /** - * Required. The resource name of the namespace whose services we'd + * Required. The resource name of the namespace whose services you'd * like to list. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -142,7 +162,7 @@ public function getParent() } /** - * Required. The resource name of the namespace whose services we'd + * Required. The resource name of the namespace whose services you'd * like to list. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -212,27 +232,31 @@ public function setPageToken($var) } /** - * Optional. The filter to list result by. - * General filter string syntax: - * () - * can be "name", or "metadata." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and - * is roughly the same as "=". - * must be the same data type as field. - * can be "AND, OR, NOT". + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `annotations.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * Examples of valid filters: - * * "metadata.owner" returns Services that have a label with the key "owner" - * this is the same as "metadata:owner". - * * "metadata.protocol=gRPC" returns Services that have key/value - * "protocol=gRPC". - * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c" - * returns Services that have name that is alphabetically later than the - * string, so "service-e" will be returned but "service-a" will not be. - * * "metadata.owner!=sd AND metadata.foo=bar" returns Services that have - * "owner" in label key but value is not "sd" AND have key/value foo=bar. - * * "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't - * have a field called "doesnotexist". Since the filter does not match any - * Services, it returns no results. + * * `annotations.owner` returns services that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns services that have key/value + * `protocol=gRPC` + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + * returns services that have name that is alphabetically later than the + * string, so "service-e" is returned but "service-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns services that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that service + * doesn't have a field called "doesnotexist". Since the filter does not + * match any services, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -243,27 +267,31 @@ public function getFilter() } /** - * Optional. The filter to list result by. - * General filter string syntax: - * () - * can be "name", or "metadata." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and - * is roughly the same as "=". - * must be the same data type as field. - * can be "AND, OR, NOT". + * Optional. The filter to list results by. + * General `filter` string syntax: + * ` ()` + * * `` can be `name` or `annotations.` for map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * Examples of valid filters: - * * "metadata.owner" returns Services that have a label with the key "owner" - * this is the same as "metadata:owner". - * * "metadata.protocol=gRPC" returns Services that have key/value - * "protocol=gRPC". - * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c" - * returns Services that have name that is alphabetically later than the - * string, so "service-e" will be returned but "service-a" will not be. - * * "metadata.owner!=sd AND metadata.foo=bar" returns Services that have - * "owner" in label key but value is not "sd" AND have key/value foo=bar. - * * "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't - * have a field called "doesnotexist". Since the filter does not match any - * Services, it returns no results. + * * `annotations.owner` returns services that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns services that have key/value + * `protocol=gRPC` + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + * returns services that have name that is alphabetically later than the + * string, so "service-e" is returned but "service-a" is not + * * `annotations.owner!=sd AND annotations.foo=bar` returns services that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that service + * doesn't have a field called "doesnotexist". Since the filter does not + * match any services, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var @@ -278,7 +306,13 @@ public function setFilter($var) } /** - * Optional. The order to list result by. + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -289,7 +323,13 @@ public function getOrderBy() } /** - * Optional. The order to list result by. + * Optional. The order to list results by. + * General `order_by` string syntax: ` () (,)` + * * `` allows value: `name` + * * `` ascending or descending order by ``. If this is + * left blank, `asc` is used + * Note that an empty `order_by` string results in default order, which is + * order by `name` in ascending order. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/ServiceDirectory/src/V1/PBNamespace.php b/ServiceDirectory/src/V1/PBNamespace.php index 11e24094982..de9bc095f14 100644 --- a/ServiceDirectory/src/V1/PBNamespace.php +++ b/ServiceDirectory/src/V1/PBNamespace.php @@ -25,13 +25,20 @@ class PBNamespace extends \Google\Protobuf\Internal\Message */ private $name = ''; /** - * Optional. Resource labels associated with this Namespace. - * No more than 64 user labels can be associated with a given resource. Label + * Optional. Resource labels associated with this namespace. + * No more than 64 user labels can be associated with a given resource. Label * keys and values can be no longer than 63 characters. * * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; */ private $labels; + /** + * Output only. The globally unique identifier of the namespace in the UUID4 + * format. + * + * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $uid = ''; /** * Constructor. @@ -43,9 +50,12 @@ class PBNamespace extends \Google\Protobuf\Internal\Message * Immutable. The resource name for the namespace in the format * `projects/*/locations/*/namespaces/*`. * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. Resource labels associated with this Namespace. - * No more than 64 user labels can be associated with a given resource. Label + * Optional. Resource labels associated with this namespace. + * No more than 64 user labels can be associated with a given resource. Label * keys and values can be no longer than 63 characters. + * @type string $uid + * Output only. The globally unique identifier of the namespace in the UUID4 + * format. * } */ public function __construct($data = NULL) { @@ -82,8 +92,8 @@ public function setName($var) } /** - * Optional. Resource labels associated with this Namespace. - * No more than 64 user labels can be associated with a given resource. Label + * Optional. Resource labels associated with this namespace. + * No more than 64 user labels can be associated with a given resource. Label * keys and values can be no longer than 63 characters. * * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -95,8 +105,8 @@ public function getLabels() } /** - * Optional. Resource labels associated with this Namespace. - * No more than 64 user labels can be associated with a given resource. Label + * Optional. Resource labels associated with this namespace. + * No more than 64 user labels can be associated with a given resource. Label * keys and values can be no longer than 63 characters. * * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -111,5 +121,33 @@ public function setLabels($var) return $this; } + /** + * Output only. The globally unique identifier of the namespace in the UUID4 + * format. + * + * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. The globally unique identifier of the namespace in the UUID4 + * format. + * + * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + } diff --git a/ServiceDirectory/src/V1/ResolveServiceRequest.php b/ServiceDirectory/src/V1/ResolveServiceRequest.php index 663648d5337..67c60759706 100644 --- a/ServiceDirectory/src/V1/ResolveServiceRequest.php +++ b/ServiceDirectory/src/V1/ResolveServiceRequest.php @@ -33,21 +33,36 @@ class ResolveServiceRequest extends \Google\Protobuf\Internal\Message private $max_endpoints = 0; /** * Optional. The filter applied to the endpoints of the resolved service. - * General filter string syntax: - * () - * can be "name" or "metadata." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is - * roughly the same as "=". - * must be the same data type as the field. - * can be "AND, OR, NOT". + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * Examples of valid filters: - * * "metadata.owner" returns Endpoints that have a label with the - * key "owner", this is the same as "metadata:owner" - * * "metadata.protocol=gRPC" returns Endpoints that have key/value - * "protocol=gRPC" - * * "metadata.owner!=sd AND metadata.foo=bar" returns - * Endpoints that have "owner" field in metadata with a value that is not - * "sd" AND have the key/value foo=bar. + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoint, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * * Generated from protobuf field string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -67,21 +82,36 @@ class ResolveServiceRequest extends \Google\Protobuf\Internal\Message * If a value greater than the Maximum is specified, the Maximum is used. * @type string $endpoint_filter * Optional. The filter applied to the endpoints of the resolved service. - * General filter string syntax: - * () - * can be "name" or "metadata." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is - * roughly the same as "=". - * must be the same data type as the field. - * can be "AND, OR, NOT". + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * Examples of valid filters: - * * "metadata.owner" returns Endpoints that have a label with the - * key "owner", this is the same as "metadata:owner" - * * "metadata.protocol=gRPC" returns Endpoints that have key/value - * "protocol=gRPC" - * * "metadata.owner!=sd AND metadata.foo=bar" returns - * Endpoints that have "owner" field in metadata with a value that is not - * "sd" AND have the key/value foo=bar. + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoint, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * } */ public function __construct($data = NULL) { @@ -147,21 +177,36 @@ public function setMaxEndpoints($var) /** * Optional. The filter applied to the endpoints of the resolved service. - * General filter string syntax: - * () - * can be "name" or "metadata." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is - * roughly the same as "=". - * must be the same data type as the field. - * can be "AND, OR, NOT". + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * Examples of valid filters: - * * "metadata.owner" returns Endpoints that have a label with the - * key "owner", this is the same as "metadata:owner" - * * "metadata.protocol=gRPC" returns Endpoints that have key/value - * "protocol=gRPC" - * * "metadata.owner!=sd AND metadata.foo=bar" returns - * Endpoints that have "owner" field in metadata with a value that is not - * "sd" AND have the key/value foo=bar. + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoint, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * * Generated from protobuf field string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -173,21 +218,36 @@ public function getEndpointFilter() /** * Optional. The filter applied to the endpoints of the resolved service. - * General filter string syntax: - * () - * can be "name" or "metadata." for map field. - * can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is - * roughly the same as "=". - * must be the same data type as the field. - * can be "AND, OR, NOT". + * General `filter` string syntax: + * ` ()` + * * `` can be `name`, `address`, `port`, or `annotations.` for + * map field + * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + * means `HAS`, and is roughly the same as `=` + * * `` must be the same data type as field + * * `` can be `AND`, `OR`, `NOT` * Examples of valid filters: - * * "metadata.owner" returns Endpoints that have a label with the - * key "owner", this is the same as "metadata:owner" - * * "metadata.protocol=gRPC" returns Endpoints that have key/value - * "protocol=gRPC" - * * "metadata.owner!=sd AND metadata.foo=bar" returns - * Endpoints that have "owner" field in metadata with a value that is not - * "sd" AND have the key/value foo=bar. + * * `annotations.owner` returns endpoints that have a annotation with the + * key `owner`, this is the same as `annotations:owner` + * * `annotations.protocol=gRPC` returns endpoints that have key/value + * `protocol=gRPC` + * * `address=192.108.1.105` returns endpoints that have this address + * * `port>8080` returns endpoints that have port number larger than 8080 + * * + * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + * returns endpoints that have name that is alphabetically later than the + * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` + * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + * have `owner` in annotation key but value is not `sd` AND have + * key/value `foo=bar` + * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + * doesn't have a field called "doesnotexist". Since the filter does not + * match any endpoint, it returns no results + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). * * Generated from protobuf field string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/ServiceDirectory/src/V1/Service.php b/ServiceDirectory/src/V1/Service.php index 571472da896..dfc5bf90e2c 100644 --- a/ServiceDirectory/src/V1/Service.php +++ b/ServiceDirectory/src/V1/Service.php @@ -29,22 +29,18 @@ class Service extends \Google\Protobuf\Internal\Message * Optional. Annotations for the service. This data can be consumed by service * clients. * Restrictions: - * - The entire annotations dictionary may contain up to 2000 characters, - * spread accoss all key-value pairs. Annotations that goes beyond any - * these limits will be rejected. - * - Valid annotation keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Annotations that fails to meet these requirements will be rejected. - * - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved - * for system annotations managed by Service Directory. If the user tries - * to write to these keyspaces, those entries will be silently ignored by - * the system. - * Note: This field is equivalent to the 'metadata' field in the v1beta1 API. + * * The entire annotations dictionary may contain up to 2000 characters, + * spread accoss all key-value pairs. Annotations that go beyond this + * limit are rejected + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/). + * Annotations that fails to meet these requirements are rejected + * Note: This field is equivalent to the `metadata` field in the v1beta1 API. * They have the same syntax and read/write to the same location in Service * Directory. * @@ -53,12 +49,20 @@ class Service extends \Google\Protobuf\Internal\Message private $annotations; /** * Output only. Endpoints associated with this service. Returned on - * LookupService.Resolve. Control plane clients should use - * RegistrationService.ListEndpoints. + * [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService]. + * Control plane clients should use + * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints]. * * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $endpoints; + /** + * Output only. The globally unique identifier of the service in the UUID4 + * format. + * + * Generated from protobuf field string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $uid = ''; /** * Constructor. @@ -73,28 +77,28 @@ class Service extends \Google\Protobuf\Internal\Message * Optional. Annotations for the service. This data can be consumed by service * clients. * Restrictions: - * - The entire annotations dictionary may contain up to 2000 characters, - * spread accoss all key-value pairs. Annotations that goes beyond any - * these limits will be rejected. - * - Valid annotation keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Annotations that fails to meet these requirements will be rejected. - * - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved - * for system annotations managed by Service Directory. If the user tries - * to write to these keyspaces, those entries will be silently ignored by - * the system. - * Note: This field is equivalent to the 'metadata' field in the v1beta1 API. + * * The entire annotations dictionary may contain up to 2000 characters, + * spread accoss all key-value pairs. Annotations that go beyond this + * limit are rejected + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/). + * Annotations that fails to meet these requirements are rejected + * Note: This field is equivalent to the `metadata` field in the v1beta1 API. * They have the same syntax and read/write to the same location in Service * Directory. * @type array<\Google\Cloud\ServiceDirectory\V1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $endpoints * Output only. Endpoints associated with this service. Returned on - * LookupService.Resolve. Control plane clients should use - * RegistrationService.ListEndpoints. + * [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService]. + * Control plane clients should use + * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints]. + * @type string $uid + * Output only. The globally unique identifier of the service in the UUID4 + * format. * } */ public function __construct($data = NULL) { @@ -134,22 +138,18 @@ public function setName($var) * Optional. Annotations for the service. This data can be consumed by service * clients. * Restrictions: - * - The entire annotations dictionary may contain up to 2000 characters, - * spread accoss all key-value pairs. Annotations that goes beyond any - * these limits will be rejected. - * - Valid annotation keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Annotations that fails to meet these requirements will be rejected. - * - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved - * for system annotations managed by Service Directory. If the user tries - * to write to these keyspaces, those entries will be silently ignored by - * the system. - * Note: This field is equivalent to the 'metadata' field in the v1beta1 API. + * * The entire annotations dictionary may contain up to 2000 characters, + * spread accoss all key-value pairs. Annotations that go beyond this + * limit are rejected + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/). + * Annotations that fails to meet these requirements are rejected + * Note: This field is equivalent to the `metadata` field in the v1beta1 API. * They have the same syntax and read/write to the same location in Service * Directory. * @@ -165,22 +165,18 @@ public function getAnnotations() * Optional. Annotations for the service. This data can be consumed by service * clients. * Restrictions: - * - The entire annotations dictionary may contain up to 2000 characters, - * spread accoss all key-value pairs. Annotations that goes beyond any - * these limits will be rejected. - * - Valid annotation keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Annotations that fails to meet these requirements will be rejected. - * - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved - * for system annotations managed by Service Directory. If the user tries - * to write to these keyspaces, those entries will be silently ignored by - * the system. - * Note: This field is equivalent to the 'metadata' field in the v1beta1 API. + * * The entire annotations dictionary may contain up to 2000 characters, + * spread accoss all key-value pairs. Annotations that go beyond this + * limit are rejected + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (/). The name segment is required and must be 63 + * characters or less, beginning and ending with an alphanumeric character + * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + * alphanumerics between. The prefix is optional. If specified, the prefix + * must be a DNS subdomain: a series of DNS labels separated by dots (.), + * not longer than 253 characters in total, followed by a slash (/). + * Annotations that fails to meet these requirements are rejected + * Note: This field is equivalent to the `metadata` field in the v1beta1 API. * They have the same syntax and read/write to the same location in Service * Directory. * @@ -198,8 +194,9 @@ public function setAnnotations($var) /** * Output only. Endpoints associated with this service. Returned on - * LookupService.Resolve. Control plane clients should use - * RegistrationService.ListEndpoints. + * [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService]. + * Control plane clients should use + * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints]. * * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Protobuf\Internal\RepeatedField @@ -211,8 +208,9 @@ public function getEndpoints() /** * Output only. Endpoints associated with this service. Returned on - * LookupService.Resolve. Control plane clients should use - * RegistrationService.ListEndpoints. + * [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService]. + * Control plane clients should use + * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints]. * * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param array<\Google\Cloud\ServiceDirectory\V1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $var @@ -226,5 +224,33 @@ public function setEndpoints($var) return $this; } + /** + * Output only. The globally unique identifier of the service in the UUID4 + * format. + * + * Generated from protobuf field string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. The globally unique identifier of the service in the UUID4 + * format. + * + * Generated from protobuf field string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + } diff --git a/ServiceDirectory/src/V1/gapic_metadata.json b/ServiceDirectory/src/V1/gapic_metadata.json index bdaec271de3..eebaffeaf39 100644 --- a/ServiceDirectory/src/V1/gapic_metadata.json +++ b/ServiceDirectory/src/V1/gapic_metadata.json @@ -14,6 +14,16 @@ "methods": [ "resolveService" ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] } } } @@ -113,6 +123,16 @@ "methods": [ "updateService" ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] } } } diff --git a/ServiceDirectory/src/V1/resources/lookup_service_client_config.json b/ServiceDirectory/src/V1/resources/lookup_service_client_config.json index 9343fec3ca4..7cc08401906 100644 --- a/ServiceDirectory/src/V1/resources/lookup_service_client_config.json +++ b/ServiceDirectory/src/V1/resources/lookup_service_client_config.json @@ -33,6 +33,16 @@ "timeout_millis": 15000, "retry_codes_name": "retry_policy_2_codes", "retry_params_name": "retry_policy_2_params" + }, + "GetLocation": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "ListLocations": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" } } } diff --git a/ServiceDirectory/src/V1/resources/lookup_service_descriptor_config.php b/ServiceDirectory/src/V1/resources/lookup_service_descriptor_config.php index 71104fb69a9..cd70e2e27a6 100644 --- a/ServiceDirectory/src/V1/resources/lookup_service_descriptor_config.php +++ b/ServiceDirectory/src/V1/resources/lookup_service_descriptor_config.php @@ -15,6 +15,40 @@ ], ], ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], 'templateMap' => [ 'service' => 'projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}', ], diff --git a/ServiceDirectory/src/V1/resources/lookup_service_rest_client_config.php b/ServiceDirectory/src/V1/resources/lookup_service_rest_client_config.php index d7bcbcf2da0..d4b279dd3b5 100644 --- a/ServiceDirectory/src/V1/resources/lookup_service_rest_client_config.php +++ b/ServiceDirectory/src/V1/resources/lookup_service_rest_client_config.php @@ -2,6 +2,30 @@ return [ 'interfaces' => [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], 'google.cloud.servicedirectory.v1.LookupService' => [ 'ResolveService' => [ 'method' => 'post', diff --git a/ServiceDirectory/src/V1/resources/registration_service_client_config.json b/ServiceDirectory/src/V1/resources/registration_service_client_config.json index 326aff9155a..2c5cb3b21d3 100644 --- a/ServiceDirectory/src/V1/resources/registration_service_client_config.json +++ b/ServiceDirectory/src/V1/resources/registration_service_client_config.json @@ -118,6 +118,16 @@ "timeout_millis": 15000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" } } } diff --git a/ServiceDirectory/src/V1/resources/registration_service_descriptor_config.php b/ServiceDirectory/src/V1/resources/registration_service_descriptor_config.php index 0c9d8dc11bc..860ab2d79c1 100644 --- a/ServiceDirectory/src/V1/resources/registration_service_descriptor_config.php +++ b/ServiceDirectory/src/V1/resources/registration_service_descriptor_config.php @@ -246,10 +246,45 @@ ], ], ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], 'templateMap' => [ 'endpoint' => 'projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}', 'location' => 'projects/{project}/locations/{location}', 'namespace' => 'projects/{project}/locations/{location}/namespaces/{namespace}', + 'network' => 'projects/{project}/locations/global/networks/{network}', 'service' => 'projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}', ], ], diff --git a/ServiceDirectory/src/V1/resources/registration_service_rest_client_config.php b/ServiceDirectory/src/V1/resources/registration_service_rest_client_config.php index 18ab39a2aed..9d81e0c9fc0 100644 --- a/ServiceDirectory/src/V1/resources/registration_service_rest_client_config.php +++ b/ServiceDirectory/src/V1/resources/registration_service_rest_client_config.php @@ -2,6 +2,30 @@ return [ 'interfaces' => [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], 'google.cloud.servicedirectory.v1.RegistrationService' => [ 'CreateEndpoint' => [ 'method' => 'post', diff --git a/ServiceDirectory/src/V1beta1/CreateEndpointRequest.php b/ServiceDirectory/src/V1beta1/CreateEndpointRequest.php index c61cf8a987b..dacd85f9b60 100644 --- a/ServiceDirectory/src/V1beta1/CreateEndpointRequest.php +++ b/ServiceDirectory/src/V1beta1/CreateEndpointRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request message for [RegistrationService.CreateEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateEndpoint]. + * The request message for + * [RegistrationService.CreateEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateEndpoint]. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.CreateEndpointRequest */ diff --git a/ServiceDirectory/src/V1beta1/CreateNamespaceRequest.php b/ServiceDirectory/src/V1beta1/CreateNamespaceRequest.php index 52db0ebde9f..1e5b94d2962 100644 --- a/ServiceDirectory/src/V1beta1/CreateNamespaceRequest.php +++ b/ServiceDirectory/src/V1beta1/CreateNamespaceRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request message for [RegistrationService.CreateNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateNamespace]. + * The request message for + * [RegistrationService.CreateNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateNamespace]. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest */ diff --git a/ServiceDirectory/src/V1beta1/CreateServiceRequest.php b/ServiceDirectory/src/V1beta1/CreateServiceRequest.php index 0d325ffc7f0..8317a262389 100644 --- a/ServiceDirectory/src/V1beta1/CreateServiceRequest.php +++ b/ServiceDirectory/src/V1beta1/CreateServiceRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request message for [RegistrationService.CreateService][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateService]. + * The request message for + * [RegistrationService.CreateService][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateService]. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.CreateServiceRequest */ diff --git a/ServiceDirectory/src/V1beta1/DeleteEndpointRequest.php b/ServiceDirectory/src/V1beta1/DeleteEndpointRequest.php index f9744fcb494..c68b423cde3 100644 --- a/ServiceDirectory/src/V1beta1/DeleteEndpointRequest.php +++ b/ServiceDirectory/src/V1beta1/DeleteEndpointRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request message for [RegistrationService.DeleteEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteEndpoint]. + * The request message for + * [RegistrationService.DeleteEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteEndpoint]. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest */ diff --git a/ServiceDirectory/src/V1beta1/DeleteNamespaceRequest.php b/ServiceDirectory/src/V1beta1/DeleteNamespaceRequest.php index e5f0ce470ff..64b1a33db90 100644 --- a/ServiceDirectory/src/V1beta1/DeleteNamespaceRequest.php +++ b/ServiceDirectory/src/V1beta1/DeleteNamespaceRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request message for [RegistrationService.DeleteNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteNamespace]. + * The request message for + * [RegistrationService.DeleteNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteNamespace]. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest */ diff --git a/ServiceDirectory/src/V1beta1/DeleteServiceRequest.php b/ServiceDirectory/src/V1beta1/DeleteServiceRequest.php index e817659e5f8..1c06e46f7e4 100644 --- a/ServiceDirectory/src/V1beta1/DeleteServiceRequest.php +++ b/ServiceDirectory/src/V1beta1/DeleteServiceRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request message for [RegistrationService.DeleteService][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteService]. + * The request message for + * [RegistrationService.DeleteService][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteService]. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.DeleteServiceRequest */ diff --git a/ServiceDirectory/src/V1beta1/Endpoint.php b/ServiceDirectory/src/V1beta1/Endpoint.php index a54e2e1a0ac..9942cb67886 100644 --- a/ServiceDirectory/src/V1beta1/Endpoint.php +++ b/ServiceDirectory/src/V1beta1/Endpoint.php @@ -25,7 +25,8 @@ class Endpoint extends \Google\Protobuf\Internal\Message */ private $name = ''; /** - * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses like: + * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + * like: * * `8.8.8` * * `8.8.8.8:53` * * `test:bad:address` @@ -57,10 +58,6 @@ class Endpoint extends \Google\Protobuf\Internal\Message * must be a DNS subdomain: a series of DNS labels separated by dots (.), * not longer than 253 characters in total, followed by a slash (/). * Metadata that fails to meet these requirements are rejected - * * The `(*.)google.com/` and `(*.)googleapis.com/` prefixes are reserved - * for system metadata managed by Service Directory. If the user tries - * to write to these keyspaces, those entries are silently ignored by - * the system * Note: This field is equivalent to the `annotations` field in the v1 API. * They have the same syntax and read/write to the same location in Service * Directory. @@ -69,8 +66,8 @@ class Endpoint extends \Google\Protobuf\Internal\Message */ private $metadata; /** - * Immutable. The Google Compute Engine network (VPC) of the endpoint in the format - * `projects//locations/global/networks/*`. + * Immutable. The Google Compute Engine network (VPC) of the endpoint in the + * format `projects//locations/global/networks/*`. * The project must be specified by project number (project id is rejected). * Incorrectly formatted networks are rejected, but no other validation * is performed on this field (ex. network or project existence, reachability, @@ -91,6 +88,13 @@ class Endpoint extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $update_time = null; + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * endpoint. + * + * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $uid = ''; /** * Constructor. @@ -102,7 +106,8 @@ class Endpoint extends \Google\Protobuf\Internal\Message * Immutable. The resource name for the endpoint in the format * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. * @type string $address - * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses like: + * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + * like: * * `8.8.8` * * `8.8.8.8:53` * * `test:bad:address` @@ -126,16 +131,12 @@ class Endpoint extends \Google\Protobuf\Internal\Message * must be a DNS subdomain: a series of DNS labels separated by dots (.), * not longer than 253 characters in total, followed by a slash (/). * Metadata that fails to meet these requirements are rejected - * * The `(*.)google.com/` and `(*.)googleapis.com/` prefixes are reserved - * for system metadata managed by Service Directory. If the user tries - * to write to these keyspaces, those entries are silently ignored by - * the system * Note: This field is equivalent to the `annotations` field in the v1 API. * They have the same syntax and read/write to the same location in Service * Directory. * @type string $network - * Immutable. The Google Compute Engine network (VPC) of the endpoint in the format - * `projects//locations/global/networks/*`. + * Immutable. The Google Compute Engine network (VPC) of the endpoint in the + * format `projects//locations/global/networks/*`. * The project must be specified by project number (project id is rejected). * Incorrectly formatted networks are rejected, but no other validation * is performed on this field (ex. network or project existence, reachability, @@ -144,6 +145,9 @@ class Endpoint extends \Google\Protobuf\Internal\Message * Output only. The timestamp when the endpoint was created. * @type \Google\Protobuf\Timestamp $update_time * Output only. The timestamp when the endpoint was last updated. + * @type string $uid + * Output only. A globally unique identifier (in UUID4 format) for this + * endpoint. * } */ public function __construct($data = NULL) { @@ -180,7 +184,8 @@ public function setName($var) } /** - * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses like: + * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + * like: * * `8.8.8` * * `8.8.8.8:53` * * `test:bad:address` @@ -197,7 +202,8 @@ public function getAddress() } /** - * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses like: + * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + * like: * * `8.8.8` * * `8.8.8.8:53` * * `test:bad:address` @@ -258,10 +264,6 @@ public function setPort($var) * must be a DNS subdomain: a series of DNS labels separated by dots (.), * not longer than 253 characters in total, followed by a slash (/). * Metadata that fails to meet these requirements are rejected - * * The `(*.)google.com/` and `(*.)googleapis.com/` prefixes are reserved - * for system metadata managed by Service Directory. If the user tries - * to write to these keyspaces, those entries are silently ignored by - * the system * Note: This field is equivalent to the `annotations` field in the v1 API. * They have the same syntax and read/write to the same location in Service * Directory. @@ -289,10 +291,6 @@ public function getMetadata() * must be a DNS subdomain: a series of DNS labels separated by dots (.), * not longer than 253 characters in total, followed by a slash (/). * Metadata that fails to meet these requirements are rejected - * * The `(*.)google.com/` and `(*.)googleapis.com/` prefixes are reserved - * for system metadata managed by Service Directory. If the user tries - * to write to these keyspaces, those entries are silently ignored by - * the system * Note: This field is equivalent to the `annotations` field in the v1 API. * They have the same syntax and read/write to the same location in Service * Directory. @@ -310,8 +308,8 @@ public function setMetadata($var) } /** - * Immutable. The Google Compute Engine network (VPC) of the endpoint in the format - * `projects//locations/global/networks/*`. + * Immutable. The Google Compute Engine network (VPC) of the endpoint in the + * format `projects//locations/global/networks/*`. * The project must be specified by project number (project id is rejected). * Incorrectly formatted networks are rejected, but no other validation * is performed on this field (ex. network or project existence, reachability, @@ -326,8 +324,8 @@ public function getNetwork() } /** - * Immutable. The Google Compute Engine network (VPC) of the endpoint in the format - * `projects//locations/global/networks/*`. + * Immutable. The Google Compute Engine network (VPC) of the endpoint in the + * format `projects//locations/global/networks/*`. * The project must be specified by project number (project id is rejected). * Incorrectly formatted networks are rejected, but no other validation * is performed on this field (ex. network or project existence, reachability, @@ -417,5 +415,33 @@ public function setUpdateTime($var) return $this; } + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * endpoint. + * + * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * endpoint. + * + * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + } diff --git a/ServiceDirectory/src/V1beta1/Gapic/LookupServiceGapicClient.php b/ServiceDirectory/src/V1beta1/Gapic/LookupServiceGapicClient.php index aeec051248c..9847a1850b1 100644 --- a/ServiceDirectory/src/V1beta1/Gapic/LookupServiceGapicClient.php +++ b/ServiceDirectory/src/V1beta1/Gapic/LookupServiceGapicClient.php @@ -27,6 +27,7 @@ namespace Google\Cloud\ServiceDirectory\V1beta1\Gapic; use Google\ApiCore\ApiException; +use Google\ApiCore\Call; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; use Google\ApiCore\PathTemplate; @@ -35,6 +36,10 @@ use Google\ApiCore\Transport\TransportInterface; use Google\ApiCore\ValidationException; use Google\Auth\FetchAuthTokenInterface; +use Google\Cloud\Location\GetLocationRequest; +use Google\Cloud\Location\ListLocationsRequest; +use Google\Cloud\Location\ListLocationsResponse; +use Google\Cloud\Location\Location; use Google\Cloud\ServiceDirectory\V1beta1\ResolveServiceRequest; use Google\Cloud\ServiceDirectory\V1beta1\ResolveServiceResponse; @@ -290,8 +295,8 @@ public function __construct(array $options = []) * Optional. * * @type int $maxEndpoints - * Optional. The maximum number of endpoints to return. Defaults to 25. Maximum is 100. - * If a value less than one is specified, the Default is used. + * Optional. The maximum number of endpoints to return. Defaults to 25. + * Maximum is 100. If a value less than one is specified, the Default is used. * If a value greater than the Maximum is specified, the Maximum is used. * @type string $endpointFilter * Optional. The filter applied to the endpoints of the resolved service. @@ -318,6 +323,9 @@ public function __construct(array $options = []) * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` * returns endpoints that have name that is alphabetically later than the * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have * `owner` in annotation key but value is not `sd` AND have key/value * `foo=bar` @@ -366,4 +374,148 @@ public function resolveService($name, array $optionalArgs = []) $request )->wait(); } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $lookupServiceClient = new LookupServiceClient(); + * try { + * $response = $lookupServiceClient->getLocation(); + * } finally { + * $lookupServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'GetLocation', + Location::class, + $optionalArgs, + $request, + Call::UNARY_CALL, + 'google.cloud.location.Locations' + )->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $lookupServiceClient = new LookupServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $lookupServiceClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $lookupServiceClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $lookupServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->getPagedListResponse( + 'ListLocations', + $optionalArgs, + ListLocationsResponse::class, + $request, + 'google.cloud.location.Locations' + ); + } } diff --git a/ServiceDirectory/src/V1beta1/Gapic/RegistrationServiceGapicClient.php b/ServiceDirectory/src/V1beta1/Gapic/RegistrationServiceGapicClient.php index 056d79c54b4..9cad2779399 100644 --- a/ServiceDirectory/src/V1beta1/Gapic/RegistrationServiceGapicClient.php +++ b/ServiceDirectory/src/V1beta1/Gapic/RegistrationServiceGapicClient.php @@ -27,6 +27,7 @@ namespace Google\Cloud\ServiceDirectory\V1beta1\Gapic; use Google\ApiCore\ApiException; +use Google\ApiCore\Call; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; use Google\ApiCore\PathTemplate; @@ -41,6 +42,10 @@ use Google\Cloud\Iam\V1\SetIamPolicyRequest; use Google\Cloud\Iam\V1\TestIamPermissionsRequest; use Google\Cloud\Iam\V1\TestIamPermissionsResponse; +use Google\Cloud\Location\GetLocationRequest; +use Google\Cloud\Location\ListLocationsRequest; +use Google\Cloud\Location\ListLocationsResponse; +use Google\Cloud\Location\Location; use Google\Cloud\ServiceDirectory\V1beta1\CreateEndpointRequest; use Google\Cloud\ServiceDirectory\V1beta1\CreateNamespaceRequest; use Google\Cloud\ServiceDirectory\V1beta1\CreateServiceRequest; @@ -859,7 +864,7 @@ public function getEndpoint($name, array $optionalArgs = []) } /** - * Gets the IAM Policy for a resource (namespace or service only). + * Gets the IAM Policy for a resource * * Sample code: * ``` @@ -1062,8 +1067,8 @@ public function getService($name, array $optionalArgs = []) * General `filter` string syntax: * ` ()` * - * * `` can be `name`, `address`, `port`, or `metadata.` for map - * field + * * `` can be `name`, `address`, `port`, `metadata.` for map + * field, or `attributes.` for attributes field * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` * means `HAS`, and is roughly the same as `=` * * `` must be the same data type as field @@ -1087,6 +1092,8 @@ public function getService($name, array $optionalArgs = []) * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint * doesn't have a field called "doesnotexist". Since the filter does not * match any endpoints, it returns no results + * * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ + * IP` returns endpoints with the corresponding kubernetes_resource_type * * For more information about filtering, see * [API Filtering](https://aip.dev/160). @@ -1175,8 +1182,8 @@ public function listEndpoints($parent, array $optionalArgs = []) * } * ``` * - * @param string $parent Required. The resource name of the project and location whose namespaces you'd like - * to list. + * @param string $parent Required. The resource name of the project and location whose namespaces + * you'd like to list. * @param array $optionalArgs { * Optional. * @@ -1195,7 +1202,8 @@ public function listEndpoints($parent, array $optionalArgs = []) * General `filter` string syntax: * ` ()` * - * * `` can be `name` or `labels.` for map field + * * `` can be `name`, `labels.` for map field, or + * `attributes.` for attributes field * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` * means `HAS`, and is roughly the same as `=` * * `` must be the same data type as field @@ -1214,6 +1222,8 @@ public function listEndpoints($parent, array $optionalArgs = []) * * `doesnotexist.foo=bar` returns an empty list. Note that namespace * doesn't have a field called "doesnotexist". Since the filter does not * match any namespaces, it returns no results + * * `attributes.managed_registration=true` returns namespaces that are + * managed by a GCP product or service * * For more information about filtering, see * [API Filtering](https://aip.dev/160). @@ -1344,6 +1354,9 @@ public function listNamespaces($parent, array $optionalArgs = []) * * `doesnotexist.foo=bar` returns an empty list. Note that service * doesn't have a field called "doesnotexist". Since the filter does not * match any services, it returns no results + * * `attributes.managed_registration=true` returns services that are + * managed + * by a GCP product or service * * For more information about filtering, see * [API Filtering](https://aip.dev/160). @@ -1407,7 +1420,7 @@ public function listServices($parent, array $optionalArgs = []) } /** - * Sets the IAM Policy for a resource (namespace or service only). + * Sets the IAM Policy for a resource * * Sample code: * ``` @@ -1474,7 +1487,8 @@ public function setIamPolicy($resource, $policy, array $optionalArgs = []) } /** - * Tests IAM permissions for a resource (namespace or service only). + * Tests IAM permissions for a resource (namespace, service or + * service workload only). * * Sample code: * ``` @@ -1700,4 +1714,148 @@ public function updateService( $request )->wait(); } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * $response = $registrationServiceClient->getLocation(); + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'GetLocation', + Location::class, + $optionalArgs, + $request, + Call::UNARY_CALL, + 'google.cloud.location.Locations' + )->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $registrationServiceClient = new RegistrationServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $registrationServiceClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $registrationServiceClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $registrationServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->getPagedListResponse( + 'ListLocations', + $optionalArgs, + ListLocationsResponse::class, + $request, + 'google.cloud.location.Locations' + ); + } } diff --git a/ServiceDirectory/src/V1beta1/GetEndpointRequest.php b/ServiceDirectory/src/V1beta1/GetEndpointRequest.php index ff1eeddb6f2..31897ee1fed 100644 --- a/ServiceDirectory/src/V1beta1/GetEndpointRequest.php +++ b/ServiceDirectory/src/V1beta1/GetEndpointRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request message for [RegistrationService.GetEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.GetEndpoint]. + * The request message for + * [RegistrationService.GetEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.GetEndpoint]. * This should not be used to lookup endpoints at runtime. Instead, use * the `resolve` method. * diff --git a/ServiceDirectory/src/V1beta1/GetNamespaceRequest.php b/ServiceDirectory/src/V1beta1/GetNamespaceRequest.php index 28123306669..9e63bdaff7a 100644 --- a/ServiceDirectory/src/V1beta1/GetNamespaceRequest.php +++ b/ServiceDirectory/src/V1beta1/GetNamespaceRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request message for [RegistrationService.GetNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.GetNamespace]. + * The request message for + * [RegistrationService.GetNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.GetNamespace]. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.GetNamespaceRequest */ diff --git a/ServiceDirectory/src/V1beta1/GetServiceRequest.php b/ServiceDirectory/src/V1beta1/GetServiceRequest.php index f91193caf19..2685687395a 100644 --- a/ServiceDirectory/src/V1beta1/GetServiceRequest.php +++ b/ServiceDirectory/src/V1beta1/GetServiceRequest.php @@ -9,8 +9,9 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request message for [RegistrationService.GetService][google.cloud.servicedirectory.v1beta1.RegistrationService.GetService]. - * This should not be used for looking up a service. Insead, use the `resolve` + * The request message for + * [RegistrationService.GetService][google.cloud.servicedirectory.v1beta1.RegistrationService.GetService]. + * This should not be used for looking up a service. Instead, use the `resolve` * method as it contains all endpoints and associated metadata. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.GetServiceRequest diff --git a/ServiceDirectory/src/V1beta1/ListEndpointsRequest.php b/ServiceDirectory/src/V1beta1/ListEndpointsRequest.php index 6c4723c0a2f..e4e4452d62e 100644 --- a/ServiceDirectory/src/V1beta1/ListEndpointsRequest.php +++ b/ServiceDirectory/src/V1beta1/ListEndpointsRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request message for [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. + * The request message for + * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.ListEndpointsRequest */ @@ -39,8 +40,8 @@ class ListEndpointsRequest extends \Google\Protobuf\Internal\Message * Optional. The filter to list results by. * General `filter` string syntax: * ` ()` - * * `` can be `name`, `address`, `port`, or `metadata.` for map - * field + * * `` can be `name`, `address`, `port`, `metadata.` for map + * field, or `attributes.` for attributes field * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` * means `HAS`, and is roughly the same as `=` * * `` must be the same data type as field @@ -62,6 +63,8 @@ class ListEndpointsRequest extends \Google\Protobuf\Internal\Message * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint * doesn't have a field called "doesnotexist". Since the filter does not * match any endpoints, it returns no results + * * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ + * IP` returns endpoints with the corresponding kubernetes_resource_type * For more information about filtering, see * [API Filtering](https://aip.dev/160). * @@ -99,8 +102,8 @@ class ListEndpointsRequest extends \Google\Protobuf\Internal\Message * Optional. The filter to list results by. * General `filter` string syntax: * ` ()` - * * `` can be `name`, `address`, `port`, or `metadata.` for map - * field + * * `` can be `name`, `address`, `port`, `metadata.` for map + * field, or `attributes.` for attributes field * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` * means `HAS`, and is roughly the same as `=` * * `` must be the same data type as field @@ -122,6 +125,8 @@ class ListEndpointsRequest extends \Google\Protobuf\Internal\Message * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint * doesn't have a field called "doesnotexist". Since the filter does not * match any endpoints, it returns no results + * * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ + * IP` returns endpoints with the corresponding kubernetes_resource_type * For more information about filtering, see * [API Filtering](https://aip.dev/160). * @type string $order_by @@ -225,8 +230,8 @@ public function setPageToken($var) * Optional. The filter to list results by. * General `filter` string syntax: * ` ()` - * * `` can be `name`, `address`, `port`, or `metadata.` for map - * field + * * `` can be `name`, `address`, `port`, `metadata.` for map + * field, or `attributes.` for attributes field * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` * means `HAS`, and is roughly the same as `=` * * `` must be the same data type as field @@ -248,6 +253,8 @@ public function setPageToken($var) * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint * doesn't have a field called "doesnotexist". Since the filter does not * match any endpoints, it returns no results + * * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ + * IP` returns endpoints with the corresponding kubernetes_resource_type * For more information about filtering, see * [API Filtering](https://aip.dev/160). * @@ -263,8 +270,8 @@ public function getFilter() * Optional. The filter to list results by. * General `filter` string syntax: * ` ()` - * * `` can be `name`, `address`, `port`, or `metadata.` for map - * field + * * `` can be `name`, `address`, `port`, `metadata.` for map + * field, or `attributes.` for attributes field * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` * means `HAS`, and is roughly the same as `=` * * `` must be the same data type as field @@ -286,6 +293,8 @@ public function getFilter() * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint * doesn't have a field called "doesnotexist". Since the filter does not * match any endpoints, it returns no results + * * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ + * IP` returns endpoints with the corresponding kubernetes_resource_type * For more information about filtering, see * [API Filtering](https://aip.dev/160). * diff --git a/ServiceDirectory/src/V1beta1/ListEndpointsResponse.php b/ServiceDirectory/src/V1beta1/ListEndpointsResponse.php index fab90077756..7558e32c2b6 100644 --- a/ServiceDirectory/src/V1beta1/ListEndpointsResponse.php +++ b/ServiceDirectory/src/V1beta1/ListEndpointsResponse.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The response message for [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. + * The response message for + * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.ListEndpointsResponse */ diff --git a/ServiceDirectory/src/V1beta1/ListNamespacesRequest.php b/ServiceDirectory/src/V1beta1/ListNamespacesRequest.php index 3fe38e654aa..f49c416460b 100644 --- a/ServiceDirectory/src/V1beta1/ListNamespacesRequest.php +++ b/ServiceDirectory/src/V1beta1/ListNamespacesRequest.php @@ -9,15 +9,16 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request message for [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1beta1.RegistrationService.ListNamespaces]. + * The request message for + * [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1beta1.RegistrationService.ListNamespaces]. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.ListNamespacesRequest */ class ListNamespacesRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The resource name of the project and location whose namespaces you'd like - * to list. + * Required. The resource name of the project and location whose namespaces + * you'd like to list. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -29,7 +30,8 @@ class ListNamespacesRequest extends \Google\Protobuf\Internal\Message */ private $page_size = 0; /** - * Optional. The next_page_token value returned from a previous List request, if any. + * Optional. The next_page_token value returned from a previous List request, + * if any. * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -38,7 +40,8 @@ class ListNamespacesRequest extends \Google\Protobuf\Internal\Message * Optional. The filter to list results by. * General `filter` string syntax: * ` ()` - * * `` can be `name` or `labels.` for map field + * * `` can be `name`, `labels.` for map field, or + * `attributes.` for attributes field * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` * means `HAS`, and is roughly the same as `=` * * `` must be the same data type as field @@ -55,6 +58,8 @@ class ListNamespacesRequest extends \Google\Protobuf\Internal\Message * * `doesnotexist.foo=bar` returns an empty list. Note that namespace * doesn't have a field called "doesnotexist". Since the filter does not * match any namespaces, it returns no results + * * `attributes.managed_registration=true` returns namespaces that are + * managed by a GCP product or service * For more information about filtering, see * [API Filtering](https://aip.dev/160). * @@ -81,17 +86,19 @@ class ListNamespacesRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $parent - * Required. The resource name of the project and location whose namespaces you'd like - * to list. + * Required. The resource name of the project and location whose namespaces + * you'd like to list. * @type int $page_size * Optional. The maximum number of items to return. * @type string $page_token - * Optional. The next_page_token value returned from a previous List request, if any. + * Optional. The next_page_token value returned from a previous List request, + * if any. * @type string $filter * Optional. The filter to list results by. * General `filter` string syntax: * ` ()` - * * `` can be `name` or `labels.` for map field + * * `` can be `name`, `labels.` for map field, or + * `attributes.` for attributes field * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` * means `HAS`, and is roughly the same as `=` * * `` must be the same data type as field @@ -108,6 +115,8 @@ class ListNamespacesRequest extends \Google\Protobuf\Internal\Message * * `doesnotexist.foo=bar` returns an empty list. Note that namespace * doesn't have a field called "doesnotexist". Since the filter does not * match any namespaces, it returns no results + * * `attributes.managed_registration=true` returns namespaces that are + * managed by a GCP product or service * For more information about filtering, see * [API Filtering](https://aip.dev/160). * @type string $order_by @@ -126,8 +135,8 @@ public function __construct($data = NULL) { } /** - * Required. The resource name of the project and location whose namespaces you'd like - * to list. + * Required. The resource name of the project and location whose namespaces + * you'd like to list. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -138,8 +147,8 @@ public function getParent() } /** - * Required. The resource name of the project and location whose namespaces you'd like - * to list. + * Required. The resource name of the project and location whose namespaces + * you'd like to list. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var @@ -180,7 +189,8 @@ public function setPageSize($var) } /** - * Optional. The next_page_token value returned from a previous List request, if any. + * Optional. The next_page_token value returned from a previous List request, + * if any. * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -191,7 +201,8 @@ public function getPageToken() } /** - * Optional. The next_page_token value returned from a previous List request, if any. + * Optional. The next_page_token value returned from a previous List request, + * if any. * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var @@ -209,7 +220,8 @@ public function setPageToken($var) * Optional. The filter to list results by. * General `filter` string syntax: * ` ()` - * * `` can be `name` or `labels.` for map field + * * `` can be `name`, `labels.` for map field, or + * `attributes.` for attributes field * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` * means `HAS`, and is roughly the same as `=` * * `` must be the same data type as field @@ -226,6 +238,8 @@ public function setPageToken($var) * * `doesnotexist.foo=bar` returns an empty list. Note that namespace * doesn't have a field called "doesnotexist". Since the filter does not * match any namespaces, it returns no results + * * `attributes.managed_registration=true` returns namespaces that are + * managed by a GCP product or service * For more information about filtering, see * [API Filtering](https://aip.dev/160). * @@ -241,7 +255,8 @@ public function getFilter() * Optional. The filter to list results by. * General `filter` string syntax: * ` ()` - * * `` can be `name` or `labels.` for map field + * * `` can be `name`, `labels.` for map field, or + * `attributes.` for attributes field * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` * means `HAS`, and is roughly the same as `=` * * `` must be the same data type as field @@ -258,6 +273,8 @@ public function getFilter() * * `doesnotexist.foo=bar` returns an empty list. Note that namespace * doesn't have a field called "doesnotexist". Since the filter does not * match any namespaces, it returns no results + * * `attributes.managed_registration=true` returns namespaces that are + * managed by a GCP product or service * For more information about filtering, see * [API Filtering](https://aip.dev/160). * diff --git a/ServiceDirectory/src/V1beta1/ListNamespacesResponse.php b/ServiceDirectory/src/V1beta1/ListNamespacesResponse.php index 8b741e803ac..f8866225a5e 100644 --- a/ServiceDirectory/src/V1beta1/ListNamespacesResponse.php +++ b/ServiceDirectory/src/V1beta1/ListNamespacesResponse.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The response message for [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1beta1.RegistrationService.ListNamespaces]. + * The response message for + * [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1beta1.RegistrationService.ListNamespaces]. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.ListNamespacesResponse */ diff --git a/ServiceDirectory/src/V1beta1/ListServicesRequest.php b/ServiceDirectory/src/V1beta1/ListServicesRequest.php index 4ea44912c51..18cb36bccaa 100644 --- a/ServiceDirectory/src/V1beta1/ListServicesRequest.php +++ b/ServiceDirectory/src/V1beta1/ListServicesRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request message for [RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices]. + * The request message for + * [RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices]. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.ListServicesRequest */ @@ -59,6 +60,9 @@ class ListServicesRequest extends \Google\Protobuf\Internal\Message * * `doesnotexist.foo=bar` returns an empty list. Note that service * doesn't have a field called "doesnotexist". Since the filter does not * match any services, it returns no results + * * `attributes.managed_registration=true` returns services that are + * managed + * by a GCP product or service * For more information about filtering, see * [API Filtering](https://aip.dev/160). * @@ -116,6 +120,9 @@ class ListServicesRequest extends \Google\Protobuf\Internal\Message * * `doesnotexist.foo=bar` returns an empty list. Note that service * doesn't have a field called "doesnotexist". Since the filter does not * match any services, it returns no results + * * `attributes.managed_registration=true` returns services that are + * managed + * by a GCP product or service * For more information about filtering, see * [API Filtering](https://aip.dev/160). * @type string $order_by @@ -239,6 +246,9 @@ public function setPageToken($var) * * `doesnotexist.foo=bar` returns an empty list. Note that service * doesn't have a field called "doesnotexist". Since the filter does not * match any services, it returns no results + * * `attributes.managed_registration=true` returns services that are + * managed + * by a GCP product or service * For more information about filtering, see * [API Filtering](https://aip.dev/160). * @@ -274,6 +284,9 @@ public function getFilter() * * `doesnotexist.foo=bar` returns an empty list. Note that service * doesn't have a field called "doesnotexist". Since the filter does not * match any services, it returns no results + * * `attributes.managed_registration=true` returns services that are + * managed + * by a GCP product or service * For more information about filtering, see * [API Filtering](https://aip.dev/160). * diff --git a/ServiceDirectory/src/V1beta1/ListServicesResponse.php b/ServiceDirectory/src/V1beta1/ListServicesResponse.php index 7b14c73fcab..79b2a103613 100644 --- a/ServiceDirectory/src/V1beta1/ListServicesResponse.php +++ b/ServiceDirectory/src/V1beta1/ListServicesResponse.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The response message for [RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices]. + * The response message for + * [RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices]. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.ListServicesResponse */ diff --git a/ServiceDirectory/src/V1beta1/PBNamespace.php b/ServiceDirectory/src/V1beta1/PBNamespace.php index 26537bbe21d..c4db1549702 100644 --- a/ServiceDirectory/src/V1beta1/PBNamespace.php +++ b/ServiceDirectory/src/V1beta1/PBNamespace.php @@ -44,6 +44,13 @@ class PBNamespace extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $update_time = null; + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * namespace. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $uid = ''; /** * Constructor. @@ -62,6 +69,9 @@ class PBNamespace extends \Google\Protobuf\Internal\Message * Output only. The timestamp when the namespace was created. * @type \Google\Protobuf\Timestamp $update_time * Output only. The timestamp when the namespace was last updated. + * @type string $uid + * Output only. A globally unique identifier (in UUID4 format) for this + * namespace. * } */ public function __construct($data = NULL) { @@ -199,5 +209,33 @@ public function setUpdateTime($var) return $this; } + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * namespace. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * namespace. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + } diff --git a/ServiceDirectory/src/V1beta1/ResolveServiceRequest.php b/ServiceDirectory/src/V1beta1/ResolveServiceRequest.php index e75f304d56e..dfc21f30c7e 100644 --- a/ServiceDirectory/src/V1beta1/ResolveServiceRequest.php +++ b/ServiceDirectory/src/V1beta1/ResolveServiceRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request message for [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. + * The request message for + * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. * Looks up a service by its name, returns the service and its endpoints. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.ResolveServiceRequest @@ -23,8 +24,8 @@ class ResolveServiceRequest extends \Google\Protobuf\Internal\Message */ private $name = ''; /** - * Optional. The maximum number of endpoints to return. Defaults to 25. Maximum is 100. - * If a value less than one is specified, the Default is used. + * Optional. The maximum number of endpoints to return. Defaults to 25. + * Maximum is 100. If a value less than one is specified, the Default is used. * If a value greater than the Maximum is specified, the Maximum is used. * * Generated from protobuf field int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -51,6 +52,9 @@ class ResolveServiceRequest extends \Google\Protobuf\Internal\Message * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` * returns endpoints that have name that is alphabetically later than the * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have * `owner` in annotation key but value is not `sd` AND have key/value * `foo=bar` @@ -73,8 +77,8 @@ class ResolveServiceRequest extends \Google\Protobuf\Internal\Message * @type string $name * Required. The name of the service to resolve. * @type int $max_endpoints - * Optional. The maximum number of endpoints to return. Defaults to 25. Maximum is 100. - * If a value less than one is specified, the Default is used. + * Optional. The maximum number of endpoints to return. Defaults to 25. + * Maximum is 100. If a value less than one is specified, the Default is used. * If a value greater than the Maximum is specified, the Maximum is used. * @type string $endpoint_filter * Optional. The filter applied to the endpoints of the resolved service. @@ -97,6 +101,9 @@ class ResolveServiceRequest extends \Google\Protobuf\Internal\Message * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` * returns endpoints that have name that is alphabetically later than the * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have * `owner` in annotation key but value is not `sd` AND have key/value * `foo=bar` @@ -139,8 +146,8 @@ public function setName($var) } /** - * Optional. The maximum number of endpoints to return. Defaults to 25. Maximum is 100. - * If a value less than one is specified, the Default is used. + * Optional. The maximum number of endpoints to return. Defaults to 25. + * Maximum is 100. If a value less than one is specified, the Default is used. * If a value greater than the Maximum is specified, the Maximum is used. * * Generated from protobuf field int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -152,8 +159,8 @@ public function getMaxEndpoints() } /** - * Optional. The maximum number of endpoints to return. Defaults to 25. Maximum is 100. - * If a value less than one is specified, the Default is used. + * Optional. The maximum number of endpoints to return. Defaults to 25. + * Maximum is 100. If a value less than one is specified, the Default is used. * If a value greater than the Maximum is specified, the Maximum is used. * * Generated from protobuf field int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -189,6 +196,9 @@ public function setMaxEndpoints($var) * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` * returns endpoints that have name that is alphabetically later than the * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have * `owner` in annotation key but value is not `sd` AND have key/value * `foo=bar` @@ -227,6 +237,9 @@ public function getEndpointFilter() * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` * returns endpoints that have name that is alphabetically later than the * string, so "endpoint-e" is returned but "endpoint-a" is not + * * + * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + * returns the endpoint that has an endpoint_id equal to `ep-1` * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have * `owner` in annotation key but value is not `sd` AND have key/value * `foo=bar` diff --git a/ServiceDirectory/src/V1beta1/ResolveServiceResponse.php b/ServiceDirectory/src/V1beta1/ResolveServiceResponse.php index af58639c7b4..b58a8aee0ed 100644 --- a/ServiceDirectory/src/V1beta1/ResolveServiceResponse.php +++ b/ServiceDirectory/src/V1beta1/ResolveServiceResponse.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The response message for [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. + * The response message for + * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.ResolveServiceResponse */ diff --git a/ServiceDirectory/src/V1beta1/Service.php b/ServiceDirectory/src/V1beta1/Service.php index 10d32f7a951..a735cfb7283 100644 --- a/ServiceDirectory/src/V1beta1/Service.php +++ b/ServiceDirectory/src/V1beta1/Service.php @@ -40,10 +40,6 @@ class Service extends \Google\Protobuf\Internal\Message * must be a DNS subdomain: a series of DNS labels separated by dots (.), * not longer than 253 characters in total, followed by a slash (/). * Metadata that fails to meet these requirements are rejected - * * The `(*.)google.com/` and `(*.)googleapis.com/` prefixes are reserved - * for system metadata managed by Service Directory. If the user tries - * to write to these keyspaces, those entries are silently ignored by - * the system * Note: This field is equivalent to the `annotations` field in the v1 API. * They have the same syntax and read/write to the same location in Service * Directory. @@ -53,7 +49,8 @@ class Service extends \Google\Protobuf\Internal\Message private $metadata; /** * Output only. Endpoints associated with this service. Returned on - * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. Control plane clients should use + * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. + * Control plane clients should use * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. * * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -66,13 +63,20 @@ class Service extends \Google\Protobuf\Internal\Message */ private $create_time = null; /** - * Output only. The timestamp when the service was last updated. Note: endpoints being - * created/deleted/updated within the service are not considered service - * updates for the purpose of this timestamp. + * Output only. The timestamp when the service was last updated. Note: + * endpoints being created/deleted/updated within the service are not + * considered service updates for the purpose of this timestamp. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $update_time = null; + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * service. + * + * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $uid = ''; /** * Constructor. @@ -98,23 +102,23 @@ class Service extends \Google\Protobuf\Internal\Message * must be a DNS subdomain: a series of DNS labels separated by dots (.), * not longer than 253 characters in total, followed by a slash (/). * Metadata that fails to meet these requirements are rejected - * * The `(*.)google.com/` and `(*.)googleapis.com/` prefixes are reserved - * for system metadata managed by Service Directory. If the user tries - * to write to these keyspaces, those entries are silently ignored by - * the system * Note: This field is equivalent to the `annotations` field in the v1 API. * They have the same syntax and read/write to the same location in Service * Directory. * @type array<\Google\Cloud\ServiceDirectory\V1beta1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $endpoints * Output only. Endpoints associated with this service. Returned on - * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. Control plane clients should use + * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. + * Control plane clients should use * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. * @type \Google\Protobuf\Timestamp $create_time * Output only. The timestamp when the service was created. * @type \Google\Protobuf\Timestamp $update_time - * Output only. The timestamp when the service was last updated. Note: endpoints being - * created/deleted/updated within the service are not considered service - * updates for the purpose of this timestamp. + * Output only. The timestamp when the service was last updated. Note: + * endpoints being created/deleted/updated within the service are not + * considered service updates for the purpose of this timestamp. + * @type string $uid + * Output only. A globally unique identifier (in UUID4 format) for this + * service. * } */ public function __construct($data = NULL) { @@ -165,10 +169,6 @@ public function setName($var) * must be a DNS subdomain: a series of DNS labels separated by dots (.), * not longer than 253 characters in total, followed by a slash (/). * Metadata that fails to meet these requirements are rejected - * * The `(*.)google.com/` and `(*.)googleapis.com/` prefixes are reserved - * for system metadata managed by Service Directory. If the user tries - * to write to these keyspaces, those entries are silently ignored by - * the system * Note: This field is equivalent to the `annotations` field in the v1 API. * They have the same syntax and read/write to the same location in Service * Directory. @@ -196,10 +196,6 @@ public function getMetadata() * must be a DNS subdomain: a series of DNS labels separated by dots (.), * not longer than 253 characters in total, followed by a slash (/). * Metadata that fails to meet these requirements are rejected - * * The `(*.)google.com/` and `(*.)googleapis.com/` prefixes are reserved - * for system metadata managed by Service Directory. If the user tries - * to write to these keyspaces, those entries are silently ignored by - * the system * Note: This field is equivalent to the `annotations` field in the v1 API. * They have the same syntax and read/write to the same location in Service * Directory. @@ -218,7 +214,8 @@ public function setMetadata($var) /** * Output only. Endpoints associated with this service. Returned on - * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. Control plane clients should use + * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. + * Control plane clients should use * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. * * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -231,7 +228,8 @@ public function getEndpoints() /** * Output only. Endpoints associated with this service. Returned on - * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. Control plane clients should use + * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. + * Control plane clients should use * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. * * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -283,9 +281,9 @@ public function setCreateTime($var) } /** - * Output only. The timestamp when the service was last updated. Note: endpoints being - * created/deleted/updated within the service are not considered service - * updates for the purpose of this timestamp. + * Output only. The timestamp when the service was last updated. Note: + * endpoints being created/deleted/updated within the service are not + * considered service updates for the purpose of this timestamp. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Protobuf\Timestamp|null @@ -306,9 +304,9 @@ public function clearUpdateTime() } /** - * Output only. The timestamp when the service was last updated. Note: endpoints being - * created/deleted/updated within the service are not considered service - * updates for the purpose of this timestamp. + * Output only. The timestamp when the service was last updated. Note: + * endpoints being created/deleted/updated within the service are not + * considered service updates for the purpose of this timestamp. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Protobuf\Timestamp $var @@ -322,5 +320,33 @@ public function setUpdateTime($var) return $this; } + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * service. + * + * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. A globally unique identifier (in UUID4 format) for this + * service. + * + * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + } diff --git a/ServiceDirectory/src/V1beta1/UpdateEndpointRequest.php b/ServiceDirectory/src/V1beta1/UpdateEndpointRequest.php index 408bc473465..71732d2dbd3 100644 --- a/ServiceDirectory/src/V1beta1/UpdateEndpointRequest.php +++ b/ServiceDirectory/src/V1beta1/UpdateEndpointRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request message for [RegistrationService.UpdateEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateEndpoint]. + * The request message for + * [RegistrationService.UpdateEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateEndpoint]. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest */ diff --git a/ServiceDirectory/src/V1beta1/UpdateNamespaceRequest.php b/ServiceDirectory/src/V1beta1/UpdateNamespaceRequest.php index 5ca6d004d37..af21227cd5c 100644 --- a/ServiceDirectory/src/V1beta1/UpdateNamespaceRequest.php +++ b/ServiceDirectory/src/V1beta1/UpdateNamespaceRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request message for [RegistrationService.UpdateNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateNamespace]. + * The request message for + * [RegistrationService.UpdateNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateNamespace]. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest */ diff --git a/ServiceDirectory/src/V1beta1/UpdateServiceRequest.php b/ServiceDirectory/src/V1beta1/UpdateServiceRequest.php index aac61e317e2..8c1bb7fa647 100644 --- a/ServiceDirectory/src/V1beta1/UpdateServiceRequest.php +++ b/ServiceDirectory/src/V1beta1/UpdateServiceRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request message for [RegistrationService.UpdateService][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateService]. + * The request message for + * [RegistrationService.UpdateService][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateService]. * * Generated from protobuf message google.cloud.servicedirectory.v1beta1.UpdateServiceRequest */ diff --git a/ServiceDirectory/src/V1beta1/gapic_metadata.json b/ServiceDirectory/src/V1beta1/gapic_metadata.json index 109f5b04bdd..417d0e2d55e 100644 --- a/ServiceDirectory/src/V1beta1/gapic_metadata.json +++ b/ServiceDirectory/src/V1beta1/gapic_metadata.json @@ -14,6 +14,16 @@ "methods": [ "resolveService" ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] } } } @@ -113,6 +123,16 @@ "methods": [ "updateService" ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] } } } diff --git a/ServiceDirectory/src/V1beta1/resources/lookup_service_client_config.json b/ServiceDirectory/src/V1beta1/resources/lookup_service_client_config.json index 3190cbcb181..667aa947cee 100644 --- a/ServiceDirectory/src/V1beta1/resources/lookup_service_client_config.json +++ b/ServiceDirectory/src/V1beta1/resources/lookup_service_client_config.json @@ -33,6 +33,16 @@ "timeout_millis": 15000, "retry_codes_name": "retry_policy_2_codes", "retry_params_name": "retry_policy_2_params" + }, + "GetLocation": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "ListLocations": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" } } } diff --git a/ServiceDirectory/src/V1beta1/resources/lookup_service_descriptor_config.php b/ServiceDirectory/src/V1beta1/resources/lookup_service_descriptor_config.php index 4178c11cd5d..893e28dc2e3 100644 --- a/ServiceDirectory/src/V1beta1/resources/lookup_service_descriptor_config.php +++ b/ServiceDirectory/src/V1beta1/resources/lookup_service_descriptor_config.php @@ -2,6 +2,21 @@ return [ 'interfaces' => [ - 'google.cloud.servicedirectory.v1beta1.LookupService' => [], + 'google.cloud.servicedirectory.v1beta1.LookupService' => [ + 'GetLocation' => [ + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + ], ], ]; diff --git a/ServiceDirectory/src/V1beta1/resources/registration_service_client_config.json b/ServiceDirectory/src/V1beta1/resources/registration_service_client_config.json index 6fb28a15f5e..3b641390ccc 100644 --- a/ServiceDirectory/src/V1beta1/resources/registration_service_client_config.json +++ b/ServiceDirectory/src/V1beta1/resources/registration_service_client_config.json @@ -118,6 +118,16 @@ "timeout_millis": 15000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 15000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" } } } diff --git a/ServiceDirectory/src/V1beta1/resources/registration_service_descriptor_config.php b/ServiceDirectory/src/V1beta1/resources/registration_service_descriptor_config.php index 6b64e6fa62b..57d31357db0 100644 --- a/ServiceDirectory/src/V1beta1/resources/registration_service_descriptor_config.php +++ b/ServiceDirectory/src/V1beta1/resources/registration_service_descriptor_config.php @@ -33,6 +33,20 @@ 'resourcesGetMethod' => 'getServices', ], ], + 'GetLocation' => [ + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], ], ], ]; diff --git a/ServiceDirectory/src/V1beta1/resources/registration_service_rest_client_config.php b/ServiceDirectory/src/V1beta1/resources/registration_service_rest_client_config.php index 79a1df8573b..d9a4440f356 100644 --- a/ServiceDirectory/src/V1beta1/resources/registration_service_rest_client_config.php +++ b/ServiceDirectory/src/V1beta1/resources/registration_service_rest_client_config.php @@ -126,6 +126,11 @@ 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:getIamPolicy', 'body' => '*', ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:getIamPolicy', + 'body' => '*', + ], ], 'placeholders' => [ 'resource' => [ @@ -200,6 +205,11 @@ 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:setIamPolicy', 'body' => '*', ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:setIamPolicy', + 'body' => '*', + ], ], 'placeholders' => [ 'resource' => [ @@ -219,6 +229,11 @@ 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions', 'body' => '*', ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:testIamPermissions', + 'body' => '*', + ], ], 'placeholders' => [ 'resource' => [ diff --git a/ServiceDirectory/tests/Unit/V1/Client/LookupServiceClientTest.php b/ServiceDirectory/tests/Unit/V1/Client/LookupServiceClientTest.php index a66acbf9839..1a6ac45c617 100644 --- a/ServiceDirectory/tests/Unit/V1/Client/LookupServiceClientTest.php +++ b/ServiceDirectory/tests/Unit/V1/Client/LookupServiceClientTest.php @@ -26,6 +26,10 @@ use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; +use Google\Cloud\Location\GetLocationRequest; +use Google\Cloud\Location\ListLocationsRequest; +use Google\Cloud\Location\ListLocationsResponse; +use Google\Cloud\Location\Location; use Google\Cloud\ServiceDirectory\V1\Client\LookupServiceClient; use Google\Cloud\ServiceDirectory\V1\ResolveServiceRequest; use Google\Cloud\ServiceDirectory\V1\ResolveServiceResponse; @@ -122,6 +126,130 @@ public function resolveServiceExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function resolveServiceAsyncTest() { diff --git a/ServiceDirectory/tests/Unit/V1/Client/RegistrationServiceClientTest.php b/ServiceDirectory/tests/Unit/V1/Client/RegistrationServiceClientTest.php index 25046463ade..638c853ca08 100644 --- a/ServiceDirectory/tests/Unit/V1/Client/RegistrationServiceClientTest.php +++ b/ServiceDirectory/tests/Unit/V1/Client/RegistrationServiceClientTest.php @@ -31,6 +31,10 @@ use Google\Cloud\Iam\V1\SetIamPolicyRequest; use Google\Cloud\Iam\V1\TestIamPermissionsRequest; use Google\Cloud\Iam\V1\TestIamPermissionsResponse; +use Google\Cloud\Location\GetLocationRequest; +use Google\Cloud\Location\ListLocationsRequest; +use Google\Cloud\Location\ListLocationsResponse; +use Google\Cloud\Location\Location; use Google\Cloud\ServiceDirectory\V1\Client\RegistrationServiceClient; use Google\Cloud\ServiceDirectory\V1\CreateEndpointRequest; use Google\Cloud\ServiceDirectory\V1\CreateNamespaceRequest; @@ -98,10 +102,14 @@ public function createEndpointTest() $name = 'name3373707'; $address = 'address-1147692044'; $port = 3446913; + $network = 'network1843485230'; + $uid = 'uid115792'; $expectedResponse = new Endpoint(); $expectedResponse->setName($name); $expectedResponse->setAddress($address); $expectedResponse->setPort($port); + $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); @@ -176,8 +184,10 @@ public function createNamespaceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name = 'name3373707'; + $uid = 'uid115792'; $expectedResponse = new PBNamespace(); $expectedResponse->setName($name); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -252,8 +262,10 @@ public function createServiceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name = 'name3373707'; + $uid = 'uid115792'; $expectedResponse = new Service(); $expectedResponse->setName($name); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); @@ -513,10 +525,14 @@ public function getEndpointTest() $name2 = 'name2-1052831874'; $address = 'address-1147692044'; $port = 3446913; + $network = 'network1843485230'; + $uid = 'uid115792'; $expectedResponse = new Endpoint(); $expectedResponse->setName($name2); $expectedResponse->setAddress($address); $expectedResponse->setPort($port); + $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); @@ -645,8 +661,10 @@ public function getNamespaceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name2 = 'name2-1052831874'; + $uid = 'uid115792'; $expectedResponse = new PBNamespace(); $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); @@ -709,8 +727,10 @@ public function getServiceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name2 = 'name2-1052831874'; + $uid = 'uid115792'; $expectedResponse = new Service(); $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); @@ -1131,10 +1151,14 @@ public function updateEndpointTest() $name = 'name3373707'; $address = 'address-1147692044'; $port = 3446913; + $network = 'network1843485230'; + $uid = 'uid115792'; $expectedResponse = new Endpoint(); $expectedResponse->setName($name); $expectedResponse->setAddress($address); $expectedResponse->setPort($port); + $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $endpoint = new Endpoint(); @@ -1203,8 +1227,10 @@ public function updateNamespaceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name = 'name3373707'; + $uid = 'uid115792'; $expectedResponse = new PBNamespace(); $expectedResponse->setName($name); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $namespace = new PBNamespace(); @@ -1273,8 +1299,10 @@ public function updateServiceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name = 'name3373707'; + $uid = 'uid115792'; $expectedResponse = new Service(); $expectedResponse->setName($name); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $service = new Service(); @@ -1333,6 +1361,130 @@ public function updateServiceExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function createEndpointAsyncTest() { @@ -1345,10 +1497,14 @@ public function createEndpointAsyncTest() $name = 'name3373707'; $address = 'address-1147692044'; $port = 3446913; + $network = 'network1843485230'; + $uid = 'uid115792'; $expectedResponse = new Endpoint(); $expectedResponse->setName($name); $expectedResponse->setAddress($address); $expectedResponse->setPort($port); + $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); diff --git a/ServiceDirectory/tests/Unit/V1/LookupServiceClientTest.php b/ServiceDirectory/tests/Unit/V1/LookupServiceClientTest.php index 1047249e79d..4dc68ce62c8 100644 --- a/ServiceDirectory/tests/Unit/V1/LookupServiceClientTest.php +++ b/ServiceDirectory/tests/Unit/V1/LookupServiceClientTest.php @@ -26,6 +26,8 @@ use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; +use Google\Cloud\Location\ListLocationsResponse; +use Google\Cloud\Location\Location; use Google\Cloud\ServiceDirectory\V1\LookupServiceClient; use Google\Cloud\ServiceDirectory\V1\ResolveServiceResponse; use Google\Rpc\Code; @@ -116,4 +118,124 @@ public function resolveServiceExceptionTest() $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } } diff --git a/ServiceDirectory/tests/Unit/V1/RegistrationServiceClientTest.php b/ServiceDirectory/tests/Unit/V1/RegistrationServiceClientTest.php index ad90a69827b..e53b9ccafb1 100644 --- a/ServiceDirectory/tests/Unit/V1/RegistrationServiceClientTest.php +++ b/ServiceDirectory/tests/Unit/V1/RegistrationServiceClientTest.php @@ -28,6 +28,8 @@ use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Iam\V1\Policy; use Google\Cloud\Iam\V1\TestIamPermissionsResponse; +use Google\Cloud\Location\ListLocationsResponse; +use Google\Cloud\Location\Location; use Google\Cloud\ServiceDirectory\V1\Endpoint; use Google\Cloud\ServiceDirectory\V1\ListEndpointsResponse; use Google\Cloud\ServiceDirectory\V1\ListNamespacesResponse; @@ -80,10 +82,14 @@ public function createEndpointTest() $name = 'name3373707'; $address = 'address-1147692044'; $port = 3446913; + $network = 'network1843485230'; + $uid = 'uid115792'; $expectedResponse = new Endpoint(); $expectedResponse->setName($name); $expectedResponse->setAddress($address); $expectedResponse->setPort($port); + $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); @@ -150,8 +156,10 @@ public function createNamespaceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name = 'name3373707'; + $uid = 'uid115792'; $expectedResponse = new PBNamespace(); $expectedResponse->setName($name); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -218,8 +226,10 @@ public function createServiceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name = 'name3373707'; + $uid = 'uid115792'; $expectedResponse = new Service(); $expectedResponse->setName($name); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); @@ -459,10 +469,14 @@ public function getEndpointTest() $name2 = 'name2-1052831874'; $address = 'address-1147692044'; $port = 3446913; + $network = 'network1843485230'; + $uid = 'uid115792'; $expectedResponse = new Endpoint(); $expectedResponse->setName($name2); $expectedResponse->setAddress($address); $expectedResponse->setPort($port); + $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); @@ -583,8 +597,10 @@ public function getNamespaceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name2 = 'name2-1052831874'; + $uid = 'uid115792'; $expectedResponse = new PBNamespace(); $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); @@ -643,8 +659,10 @@ public function getServiceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name2 = 'name2-1052831874'; + $uid = 'uid115792'; $expectedResponse = new Service(); $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); @@ -1037,10 +1055,14 @@ public function updateEndpointTest() $name = 'name3373707'; $address = 'address-1147692044'; $port = 3446913; + $network = 'network1843485230'; + $uid = 'uid115792'; $expectedResponse = new Endpoint(); $expectedResponse->setName($name); $expectedResponse->setAddress($address); $expectedResponse->setPort($port); + $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $endpoint = new Endpoint(); @@ -1103,8 +1125,10 @@ public function updateNamespaceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name = 'name3373707'; + $uid = 'uid115792'; $expectedResponse = new PBNamespace(); $expectedResponse->setName($name); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $namespace = new PBNamespace(); @@ -1167,8 +1191,10 @@ public function updateServiceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name = 'name3373707'; + $uid = 'uid115792'; $expectedResponse = new Service(); $expectedResponse->setName($name); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $service = new Service(); @@ -1220,4 +1246,124 @@ public function updateServiceExceptionTest() $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } } diff --git a/ServiceDirectory/tests/Unit/V1beta1/LookupServiceClientTest.php b/ServiceDirectory/tests/Unit/V1beta1/LookupServiceClientTest.php index 651ce623987..5965e2192a5 100644 --- a/ServiceDirectory/tests/Unit/V1beta1/LookupServiceClientTest.php +++ b/ServiceDirectory/tests/Unit/V1beta1/LookupServiceClientTest.php @@ -26,6 +26,8 @@ use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; +use Google\Cloud\Location\ListLocationsResponse; +use Google\Cloud\Location\Location; use Google\Cloud\ServiceDirectory\V1beta1\LookupServiceClient; use Google\Cloud\ServiceDirectory\V1beta1\ResolveServiceResponse; use Google\Rpc\Code; @@ -116,4 +118,124 @@ public function resolveServiceExceptionTest() $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } } diff --git a/ServiceDirectory/tests/Unit/V1beta1/RegistrationServiceClientTest.php b/ServiceDirectory/tests/Unit/V1beta1/RegistrationServiceClientTest.php index 6247aa374b3..0199b4af37c 100644 --- a/ServiceDirectory/tests/Unit/V1beta1/RegistrationServiceClientTest.php +++ b/ServiceDirectory/tests/Unit/V1beta1/RegistrationServiceClientTest.php @@ -28,6 +28,8 @@ use Google\ApiCore\Testing\MockTransport; use Google\Cloud\Iam\V1\Policy; use Google\Cloud\Iam\V1\TestIamPermissionsResponse; +use Google\Cloud\Location\ListLocationsResponse; +use Google\Cloud\Location\Location; use Google\Cloud\ServiceDirectory\V1beta1\Endpoint; use Google\Cloud\ServiceDirectory\V1beta1\ListEndpointsResponse; use Google\Cloud\ServiceDirectory\V1beta1\ListNamespacesResponse; @@ -81,11 +83,13 @@ public function createEndpointTest() $address = 'address-1147692044'; $port = 3446913; $network = 'network1843485230'; + $uid = 'uid115792'; $expectedResponse = new Endpoint(); $expectedResponse->setName($name); $expectedResponse->setAddress($address); $expectedResponse->setPort($port); $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); @@ -152,8 +156,10 @@ public function createNamespaceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name = 'name3373707'; + $uid = 'uid115792'; $expectedResponse = new PBNamespace(); $expectedResponse->setName($name); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -220,8 +226,10 @@ public function createServiceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name = 'name3373707'; + $uid = 'uid115792'; $expectedResponse = new Service(); $expectedResponse->setName($name); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); @@ -462,11 +470,13 @@ public function getEndpointTest() $address = 'address-1147692044'; $port = 3446913; $network = 'network1843485230'; + $uid = 'uid115792'; $expectedResponse = new Endpoint(); $expectedResponse->setName($name2); $expectedResponse->setAddress($address); $expectedResponse->setPort($port); $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); @@ -587,8 +597,10 @@ public function getNamespaceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name2 = 'name2-1052831874'; + $uid = 'uid115792'; $expectedResponse = new PBNamespace(); $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); @@ -647,8 +659,10 @@ public function getServiceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name2 = 'name2-1052831874'; + $uid = 'uid115792'; $expectedResponse = new Service(); $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); @@ -1042,11 +1056,13 @@ public function updateEndpointTest() $address = 'address-1147692044'; $port = 3446913; $network = 'network1843485230'; + $uid = 'uid115792'; $expectedResponse = new Endpoint(); $expectedResponse->setName($name); $expectedResponse->setAddress($address); $expectedResponse->setPort($port); $expectedResponse->setNetwork($network); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $endpoint = new Endpoint(); @@ -1109,8 +1125,10 @@ public function updateNamespaceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name = 'name3373707'; + $uid = 'uid115792'; $expectedResponse = new PBNamespace(); $expectedResponse->setName($name); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $namespace = new PBNamespace(); @@ -1173,8 +1191,10 @@ public function updateServiceTest() $this->assertTrue($transport->isExhausted()); // Mock response $name = 'name3373707'; + $uid = 'uid115792'; $expectedResponse = new Service(); $expectedResponse->setName($name); + $expectedResponse->setUid($uid); $transport->addResponse($expectedResponse); // Mock request $service = new Service(); @@ -1226,4 +1246,124 @@ public function updateServiceExceptionTest() $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } } diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/Endpoint.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/Endpoint.php deleted file mode 100644 index 0ca6bf3933c..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/Endpoint.php +++ /dev/null @@ -1,42 +0,0 @@ -internalAddGeneratedFile( - ' - -/google/cloud/servicedirectory/v1/endpoint.proto google.cloud.servicedirectory.v1google/api/resource.proto" -Endpoint -name ( BA -address ( BA -port (BAU - annotations ( 2;.google.cloud.servicedirectory.v1.Endpoint.AnnotationsEntryBA@ -network ( B/AA) -\'servicedirectory.googleapis.com/Network -uid ( BA2 -AnnotationsEntry -key (  -value ( :8:A -(servicedirectory.googleapis.com/Endpointfprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}B -$com.google.cloud.servicedirectory.v1B EndpointProtoPZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb Google.Cloud.ServiceDirectory.V1 Google\\Cloud\\ServiceDirectory\\V1#Google::Cloud::ServiceDirectory::V1Aa -\'servicedirectory.googleapis.com/Network6projects/{project}/locations/global/networks/{network}bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/LookupService.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/LookupService.php deleted file mode 100644 index 96f5c1fda89..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/LookupService.php +++ /dev/null @@ -1,41 +0,0 @@ -internalAddGeneratedFile( - ' - -5google/cloud/servicedirectory/v1/lookup_service.proto google.cloud.servicedirectory.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto.google/cloud/servicedirectory/v1/service.proto" -ResolveServiceRequest= -name ( B/AA) -\'servicedirectory.googleapis.com/Service - max_endpoints (BA -endpoint_filter ( BA"T -ResolveServiceResponse: -service ( 2).google.cloud.servicedirectory.v1.Service2 - LookupService -ResolveService7.google.cloud.servicedirectory.v1.ResolveServiceRequest8.google.cloud.servicedirectory.v1.ResolveServiceResponse"LF"A/v1/{name=projects/*/locations/*/namespaces/*/services/*}:resolve:*SAservicedirectory.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB -$com.google.cloud.servicedirectory.v1BLookupServiceProtoPZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb Google.Cloud.ServiceDirectory.V1 Google\\Cloud\\ServiceDirectory\\V1#Google::Cloud::ServiceDirectory::V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/PBNamespace.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/PBNamespace.php deleted file mode 100644 index 90e97166da9..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/PBNamespace.php +++ /dev/null @@ -1,37 +0,0 @@ -internalAddGeneratedFile( - ' - -0google/cloud/servicedirectory/v1/namespace.proto google.cloud.servicedirectory.v1google/api/resource.proto" - Namespace -name ( BAL -labels ( 27.google.cloud.servicedirectory.v1.Namespace.LabelsEntryBA -uid ( BA- - LabelsEntry -key (  -value ( :8:nAk -)servicedirectory.googleapis.com/Namespace>projects/{project}/locations/{location}/namespaces/{namespace}B -$com.google.cloud.servicedirectory.v1BNamespaceProtoPZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb Google.Cloud.ServiceDirectory.V1 Google\\Cloud\\ServiceDirectory\\V1#Google::Cloud::ServiceDirectory::V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/RegistrationService.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/RegistrationService.php deleted file mode 100644 index 312acf036ea..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/RegistrationService.php +++ /dev/null @@ -1,135 +0,0 @@ -internalAddGeneratedFile( - ' -7 -;google/cloud/servicedirectory/v1/registration_service.proto google.cloud.servicedirectory.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto/google/cloud/servicedirectory/v1/endpoint.proto0google/cloud/servicedirectory/v1/namespace.proto.google/cloud/servicedirectory/v1/service.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto" -CreateNamespaceRequest9 -parent ( B)AA# -!locations.googleapis.com/Location - namespace_id ( BAC - namespace ( 2+.google.cloud.servicedirectory.v1.NamespaceBA" -ListNamespacesRequest9 -parent ( B)AA# -!locations.googleapis.com/Location - page_size (BA - -page_token ( BA -filter ( BA -order_by ( BA"r -ListNamespacesResponse? - -namespaces ( 2+.google.cloud.servicedirectory.v1.Namespace -next_page_token ( "V -GetNamespaceRequest? -name ( B1AA+ -)servicedirectory.googleapis.com/Namespace" -UpdateNamespaceRequestC - namespace ( 2+.google.cloud.servicedirectory.v1.NamespaceBA4 - update_mask ( 2.google.protobuf.FieldMaskBA"Y -DeleteNamespaceRequest? -name ( B1AA+ -)servicedirectory.googleapis.com/Namespace" -CreateServiceRequestA -parent ( B1AA+ -)servicedirectory.googleapis.com/Namespace - -service_id ( BA? -service ( 2).google.cloud.servicedirectory.v1.ServiceBA" -ListServicesRequestA -parent ( B1AA+ -)servicedirectory.googleapis.com/Namespace - page_size (BA - -page_token ( BA -filter ( BA -order_by ( BA"l -ListServicesResponse; -services ( 2).google.cloud.servicedirectory.v1.Service -next_page_token ( "R -GetServiceRequest= -name ( B/AA) -\'servicedirectory.googleapis.com/Service" -UpdateServiceRequest? -service ( 2).google.cloud.servicedirectory.v1.ServiceBA4 - update_mask ( 2.google.protobuf.FieldMaskBA"U -DeleteServiceRequest= -name ( B/AA) -\'servicedirectory.googleapis.com/Service" -CreateEndpointRequest? -parent ( B/AA) -\'servicedirectory.googleapis.com/Service - endpoint_id ( BAA -endpoint ( 2*.google.cloud.servicedirectory.v1.EndpointBA" -ListEndpointsRequest? -parent ( B/AA) -\'servicedirectory.googleapis.com/Service - page_size (BA - -page_token ( BA -filter ( BA -order_by ( BA"o -ListEndpointsResponse= - endpoints ( 2*.google.cloud.servicedirectory.v1.Endpoint -next_page_token ( "T -GetEndpointRequest> -name ( B0AA* -(servicedirectory.googleapis.com/Endpoint" -UpdateEndpointRequestA -endpoint ( 2*.google.cloud.servicedirectory.v1.EndpointBA4 - update_mask ( 2.google.protobuf.FieldMaskBA"W -DeleteEndpointRequest> -name ( B0AA* -(servicedirectory.googleapis.com/Endpoint2 -RegistrationService -CreateNamespace8.google.cloud.servicedirectory.v1.CreateNamespaceRequest+.google.cloud.servicedirectory.v1.Namespace"a;"./v1/{parent=projects/*/locations/*}/namespaces: namespaceAparent,namespace,namespace_id -ListNamespaces7.google.cloud.servicedirectory.v1.ListNamespacesRequest8.google.cloud.servicedirectory.v1.ListNamespacesResponse"?0./v1/{parent=projects/*/locations/*}/namespacesAparent - GetNamespace5.google.cloud.servicedirectory.v1.GetNamespaceRequest+.google.cloud.servicedirectory.v1.Namespace"=0./v1/{name=projects/*/locations/*/namespaces/*}Aname -UpdateNamespace8.google.cloud.servicedirectory.v1.UpdateNamespaceRequest+.google.cloud.servicedirectory.v1.Namespace"cE28/v1/{namespace.name=projects/*/locations/*/namespaces/*}: namespaceAnamespace,update_mask -DeleteNamespace8.google.cloud.servicedirectory.v1.DeleteNamespaceRequest.google.protobuf.Empty"=0*./v1/{name=projects/*/locations/*/namespaces/*}Aname - CreateService6.google.cloud.servicedirectory.v1.CreateServiceRequest).google.cloud.servicedirectory.v1.Service"fD"9/v1/{parent=projects/*/locations/*/namespaces/*}/services:serviceAparent,service,service_id - ListServices5.google.cloud.servicedirectory.v1.ListServicesRequest6.google.cloud.servicedirectory.v1.ListServicesResponse"J;9/v1/{parent=projects/*/locations/*/namespaces/*}/servicesAparent - -GetService3.google.cloud.servicedirectory.v1.GetServiceRequest).google.cloud.servicedirectory.v1.Service"H;9/v1/{name=projects/*/locations/*/namespaces/*/services/*}Aname - UpdateService6.google.cloud.servicedirectory.v1.UpdateServiceRequest).google.cloud.servicedirectory.v1.Service"hL2A/v1/{service.name=projects/*/locations/*/namespaces/*/services/*}:serviceAservice,update_mask - DeleteService6.google.cloud.servicedirectory.v1.DeleteServiceRequest.google.protobuf.Empty"H;*9/v1/{name=projects/*/locations/*/namespaces/*/services/*}Aname -CreateEndpoint7.google.cloud.servicedirectory.v1.CreateEndpointRequest*.google.cloud.servicedirectory.v1.Endpoint"uQ"E/v1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints:endpointAparent,endpoint,endpoint_id - ListEndpoints6.google.cloud.servicedirectory.v1.ListEndpointsRequest7.google.cloud.servicedirectory.v1.ListEndpointsResponse"VGE/v1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpointsAparent - GetEndpoint4.google.cloud.servicedirectory.v1.GetEndpointRequest*.google.cloud.servicedirectory.v1.Endpoint"TGE/v1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}Aname -UpdateEndpoint7.google.cloud.servicedirectory.v1.UpdateEndpointRequest*.google.cloud.servicedirectory.v1.Endpoint"wZ2N/v1/{endpoint.name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}:endpointAendpoint,update_mask -DeleteEndpoint7.google.cloud.servicedirectory.v1.DeleteEndpointRequest.google.protobuf.Empty"TG*E/v1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}Aname - GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy""?/v1/{resource=projects/*/locations/*/namespaces/*}:getIamPolicy:*ZO"J/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:getIamPolicy:* - SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy""?/v1/{resource=projects/*/locations/*/namespaces/*}:setIamPolicy:*ZO"J/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:setIamPolicy:* -TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse""E/v1/{resource=projects/*/locations/*/namespaces/*}:testIamPermissions:*ZU"P/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions:*SAservicedirectory.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB -$com.google.cloud.servicedirectory.v1BRegistrationServiceProtoPZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb Google.Cloud.ServiceDirectory.V1 Google\\Cloud\\ServiceDirectory\\V1#Google::Cloud::ServiceDirectory::V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/Service.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/Service.php deleted file mode 100644 index f2fbabaaef6..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1/Service.php +++ /dev/null @@ -1,39 +0,0 @@ -internalAddGeneratedFile( - ' - -.google/cloud/servicedirectory/v1/service.proto google.cloud.servicedirectory.v1google/api/resource.proto/google/cloud/servicedirectory/v1/endpoint.proto" -Service -name ( BAT - annotations ( 2:.google.cloud.servicedirectory.v1.Service.AnnotationsEntryBAB - endpoints ( 2*.google.cloud.servicedirectory.v1.EndpointBA -uid ( BA2 -AnnotationsEntry -key (  -value ( :8:A| -\'servicedirectory.googleapis.com/ServiceQprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}B -$com.google.cloud.servicedirectory.v1B ServiceProtoPZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb Google.Cloud.ServiceDirectory.V1 Google\\Cloud\\ServiceDirectory\\V1#Google::Cloud::ServiceDirectory::V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateEndpointRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateEndpointRequest.php deleted file mode 100644 index ca922f44227..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateEndpointRequest.php +++ /dev/null @@ -1,194 +0,0 @@ -google.cloud.servicedirectory.v1.CreateEndpointRequest - */ -class CreateEndpointRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the service that this endpoint provides. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $endpoint_id = ''; - /** - * Required. A endpoint with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $endpoint = null; - - /** - * @param string $parent Required. The resource name of the service that this endpoint provides. Please see - * {@see RegistrationServiceClient::serviceName()} for help formatting this field. - * @param \Google\Cloud\ServiceDirectory\V1\Endpoint $endpoint Required. A endpoint with initial fields set. - * @param string $endpointId Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * @return \Google\Cloud\ServiceDirectory\V1\CreateEndpointRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\ServiceDirectory\V1\Endpoint $endpoint, string $endpointId): self - { - return (new self()) - ->setParent($parent) - ->setEndpoint($endpoint) - ->setEndpointId($endpointId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the service that this endpoint provides. - * @type string $endpoint_id - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * @type \Google\Cloud\ServiceDirectory\V1\Endpoint $endpoint - * Required. A endpoint with initial fields set. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the service that this endpoint provides. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The resource name of the service that this endpoint provides. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getEndpointId() - { - return $this->endpoint_id; - } - - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setEndpointId($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_id = $var; - - return $this; - } - - /** - * Required. A endpoint with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ServiceDirectory\V1\Endpoint|null - */ - public function getEndpoint() - { - return $this->endpoint; - } - - public function hasEndpoint() - { - return isset($this->endpoint); - } - - public function clearEndpoint() - { - unset($this->endpoint); - } - - /** - * Required. A endpoint with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ServiceDirectory\V1\Endpoint $var - * @return $this - */ - public function setEndpoint($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1\Endpoint::class); - $this->endpoint = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateNamespaceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateNamespaceRequest.php deleted file mode 100644 index 3cc325452b4..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateNamespaceRequest.php +++ /dev/null @@ -1,199 +0,0 @@ -google.cloud.servicedirectory.v1.CreateNamespaceRequest - */ -class CreateNamespaceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the project and location the namespace - * will be created in. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $namespace_id = ''; - /** - * Required. A namespace with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $namespace = null; - - /** - * @param string $parent Required. The resource name of the project and location the namespace - * will be created in. Please see - * {@see RegistrationServiceClient::locationName()} for help formatting this field. - * @param \Google\Cloud\ServiceDirectory\V1\PBNamespace $namespace Required. A namespace with initial fields set. - * @param string $namespaceId Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * @return \Google\Cloud\ServiceDirectory\V1\CreateNamespaceRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\ServiceDirectory\V1\PBNamespace $namespace, string $namespaceId): self - { - return (new self()) - ->setParent($parent) - ->setNamespace($namespace) - ->setNamespaceId($namespaceId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the project and location the namespace - * will be created in. - * @type string $namespace_id - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * @type \Google\Cloud\ServiceDirectory\V1\PBNamespace $namespace - * Required. A namespace with initial fields set. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the project and location the namespace - * will be created in. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The resource name of the project and location the namespace - * will be created in. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getNamespaceId() - { - return $this->namespace_id; - } - - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setNamespaceId($var) - { - GPBUtil::checkString($var, True); - $this->namespace_id = $var; - - return $this; - } - - /** - * Required. A namespace with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ServiceDirectory\V1\PBNamespace|null - */ - public function getNamespace() - { - return $this->namespace; - } - - public function hasNamespace() - { - return isset($this->namespace); - } - - public function clearNamespace() - { - unset($this->namespace); - } - - /** - * Required. A namespace with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ServiceDirectory\V1\PBNamespace $var - * @return $this - */ - public function setNamespace($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1\PBNamespace::class); - $this->namespace = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateServiceRequest.php deleted file mode 100644 index 2dadd01b1ae..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/CreateServiceRequest.php +++ /dev/null @@ -1,194 +0,0 @@ -google.cloud.servicedirectory.v1.CreateServiceRequest - */ -class CreateServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the namespace this service will belong to. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $service_id = ''; - /** - * Required. A service with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $service = null; - - /** - * @param string $parent Required. The resource name of the namespace this service will belong to. Please see - * {@see RegistrationServiceClient::namespaceName()} for help formatting this field. - * @param \Google\Cloud\ServiceDirectory\V1\Service $service Required. A service with initial fields set. - * @param string $serviceId Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * @return \Google\Cloud\ServiceDirectory\V1\CreateServiceRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\ServiceDirectory\V1\Service $service, string $serviceId): self - { - return (new self()) - ->setParent($parent) - ->setService($service) - ->setServiceId($serviceId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the namespace this service will belong to. - * @type string $service_id - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * @type \Google\Cloud\ServiceDirectory\V1\Service $service - * Required. A service with initial fields set. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the namespace this service will belong to. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The resource name of the namespace this service will belong to. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getServiceId() - { - return $this->service_id; - } - - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setServiceId($var) - { - GPBUtil::checkString($var, True); - $this->service_id = $var; - - return $this; - } - - /** - * Required. A service with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ServiceDirectory\V1\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Required. A service with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ServiceDirectory\V1\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1\Service::class); - $this->service = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteEndpointRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteEndpointRequest.php deleted file mode 100644 index b2c6e030a32..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteEndpointRequest.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.servicedirectory.v1.DeleteEndpointRequest - */ -class DeleteEndpointRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the endpoint to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the endpoint to delete. Please see - * {@see RegistrationServiceClient::endpointName()} for help formatting this field. - * - * @return \Google\Cloud\ServiceDirectory\V1\DeleteEndpointRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the endpoint to delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the endpoint to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the endpoint to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteNamespaceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteNamespaceRequest.php deleted file mode 100644 index 30a5b39f2b0..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteNamespaceRequest.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.servicedirectory.v1.DeleteNamespaceRequest - */ -class DeleteNamespaceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the namespace to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the namespace to delete. Please see - * {@see RegistrationServiceClient::namespaceName()} for help formatting this field. - * - * @return \Google\Cloud\ServiceDirectory\V1\DeleteNamespaceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the namespace to delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the namespace to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the namespace to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteServiceRequest.php deleted file mode 100644 index 06c9a513015..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/DeleteServiceRequest.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.servicedirectory.v1.DeleteServiceRequest - */ -class DeleteServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the service to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the service to delete. Please see - * {@see RegistrationServiceClient::serviceName()} for help formatting this field. - * - * @return \Google\Cloud\ServiceDirectory\V1\DeleteServiceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the service to delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the service to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the service to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/Endpoint.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/Endpoint.php deleted file mode 100644 index ae05e9afd6d..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/Endpoint.php +++ /dev/null @@ -1,359 +0,0 @@ -google.cloud.servicedirectory.v1.Endpoint - */ -class Endpoint extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The resource name for the endpoint in the format - * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses - * like: - * * `8.8.8` - * * `8.8.8.8:53` - * * `test:bad:address` - * * `[::1]` - * * `[::1]:8080` - * Limited to 45 characters. - * - * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $address = ''; - /** - * Optional. Service Directory rejects values outside of `[0, 65535]`. - * - * Generated from protobuf field int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $port = 0; - /** - * Optional. Annotations for the endpoint. This data can be consumed by - * service clients. - * Restrictions: - * * The entire annotations dictionary may contain up to 512 characters, - * spread accoss all key-value pairs. Annotations that go beyond this - * limit are rejected - * * Valid annotation keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/) - * Annotations that fails to meet these requirements are rejected. - * Note: This field is equivalent to the `metadata` field in the v1beta1 API. - * They have the same syntax and read/write to the same location in Service - * Directory. - * - * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $annotations; - /** - * Immutable. The Google Compute Engine network (VPC) of the endpoint in the - * format `projects//locations/global/networks/*`. - * The project must be specified by project number (project id is rejected). - * Incorrectly formatted networks are rejected, we also check to make sure - * that you have the servicedirectory.networks.attach permission on the - * project specified. - * - * Generated from protobuf field string network = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - */ - protected $network = ''; - /** - * Output only. The globally unique identifier of the endpoint in the UUID4 - * format. - * - * Generated from protobuf field string uid = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The resource name for the endpoint in the format - * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - * @type string $address - * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses - * like: - * * `8.8.8` - * * `8.8.8.8:53` - * * `test:bad:address` - * * `[::1]` - * * `[::1]:8080` - * Limited to 45 characters. - * @type int $port - * Optional. Service Directory rejects values outside of `[0, 65535]`. - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Optional. Annotations for the endpoint. This data can be consumed by - * service clients. - * Restrictions: - * * The entire annotations dictionary may contain up to 512 characters, - * spread accoss all key-value pairs. Annotations that go beyond this - * limit are rejected - * * Valid annotation keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/) - * Annotations that fails to meet these requirements are rejected. - * Note: This field is equivalent to the `metadata` field in the v1beta1 API. - * They have the same syntax and read/write to the same location in Service - * Directory. - * @type string $network - * Immutable. The Google Compute Engine network (VPC) of the endpoint in the - * format `projects//locations/global/networks/*`. - * The project must be specified by project number (project id is rejected). - * Incorrectly formatted networks are rejected, we also check to make sure - * that you have the servicedirectory.networks.attach permission on the - * project specified. - * @type string $uid - * Output only. The globally unique identifier of the endpoint in the UUID4 - * format. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\Endpoint::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The resource name for the endpoint in the format - * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The resource name for the endpoint in the format - * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses - * like: - * * `8.8.8` - * * `8.8.8.8:53` - * * `test:bad:address` - * * `[::1]` - * * `[::1]:8080` - * Limited to 45 characters. - * - * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAddress() - { - return $this->address; - } - - /** - * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses - * like: - * * `8.8.8` - * * `8.8.8.8:53` - * * `test:bad:address` - * * `[::1]` - * * `[::1]:8080` - * Limited to 45 characters. - * - * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAddress($var) - { - GPBUtil::checkString($var, True); - $this->address = $var; - - return $this; - } - - /** - * Optional. Service Directory rejects values outside of `[0, 65535]`. - * - * Generated from protobuf field int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * Optional. Service Directory rejects values outside of `[0, 65535]`. - * - * Generated from protobuf field int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPort($var) - { - GPBUtil::checkInt32($var); - $this->port = $var; - - return $this; - } - - /** - * Optional. Annotations for the endpoint. This data can be consumed by - * service clients. - * Restrictions: - * * The entire annotations dictionary may contain up to 512 characters, - * spread accoss all key-value pairs. Annotations that go beyond this - * limit are rejected - * * Valid annotation keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/) - * Annotations that fails to meet these requirements are rejected. - * Note: This field is equivalent to the `metadata` field in the v1beta1 API. - * They have the same syntax and read/write to the same location in Service - * Directory. - * - * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Optional. Annotations for the endpoint. This data can be consumed by - * service clients. - * Restrictions: - * * The entire annotations dictionary may contain up to 512 characters, - * spread accoss all key-value pairs. Annotations that go beyond this - * limit are rejected - * * Valid annotation keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/) - * Annotations that fails to meet these requirements are rejected. - * Note: This field is equivalent to the `metadata` field in the v1beta1 API. - * They have the same syntax and read/write to the same location in Service - * Directory. - * - * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Immutable. The Google Compute Engine network (VPC) of the endpoint in the - * format `projects//locations/global/networks/*`. - * The project must be specified by project number (project id is rejected). - * Incorrectly formatted networks are rejected, we also check to make sure - * that you have the servicedirectory.networks.attach permission on the - * project specified. - * - * Generated from protobuf field string network = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * Immutable. The Google Compute Engine network (VPC) of the endpoint in the - * format `projects//locations/global/networks/*`. - * The project must be specified by project number (project id is rejected). - * Incorrectly formatted networks are rejected, we also check to make sure - * that you have the servicedirectory.networks.attach permission on the - * project specified. - * - * Generated from protobuf field string network = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * Output only. The globally unique identifier of the endpoint in the UUID4 - * format. - * - * Generated from protobuf field string uid = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The globally unique identifier of the endpoint in the UUID4 - * format. - * - * Generated from protobuf field string uid = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetEndpointRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetEndpointRequest.php deleted file mode 100644 index 5be9f51563f..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetEndpointRequest.php +++ /dev/null @@ -1,84 +0,0 @@ -google.cloud.servicedirectory.v1.GetEndpointRequest - */ -class GetEndpointRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the endpoint to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the endpoint to get. Please see - * {@see RegistrationServiceClient::endpointName()} for help formatting this field. - * - * @return \Google\Cloud\ServiceDirectory\V1\GetEndpointRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the endpoint to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the endpoint to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the endpoint to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetNamespaceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetNamespaceRequest.php deleted file mode 100644 index d5cd6575043..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetNamespaceRequest.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.servicedirectory.v1.GetNamespaceRequest - */ -class GetNamespaceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the namespace to retrieve. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the namespace to retrieve. Please see - * {@see RegistrationServiceClient::namespaceName()} for help formatting this field. - * - * @return \Google\Cloud\ServiceDirectory\V1\GetNamespaceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the namespace to retrieve. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the namespace to retrieve. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the namespace to retrieve. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetServiceRequest.php deleted file mode 100644 index 2762f237541..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/GetServiceRequest.php +++ /dev/null @@ -1,84 +0,0 @@ -google.cloud.servicedirectory.v1.GetServiceRequest - */ -class GetServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the service to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the service to get. Please see - * {@see RegistrationServiceClient::serviceName()} for help formatting this field. - * - * @return \Google\Cloud\ServiceDirectory\V1\GetServiceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the service to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the service to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the service to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListEndpointsRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListEndpointsRequest.php deleted file mode 100644 index 00c7d5ca1bc..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListEndpointsRequest.php +++ /dev/null @@ -1,359 +0,0 @@ -google.cloud.servicedirectory.v1.ListEndpointsRequest - */ -class ListEndpointsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the service whose endpoints you'd like to - * list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `address`, `port`, or `annotations.` for - * map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `annotations.owner` returns endpoints that have a annotation with the - * key `owner`, this is the same as `annotations:owner` - * * `annotations.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that - * have `owner` in annotation key but value is not `sd` AND have - * key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoints, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows values: `name`, `address`, `port` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. The resource name of the service whose endpoints you'd like to - * list. Please see - * {@see RegistrationServiceClient::serviceName()} for help formatting this field. - * - * @return \Google\Cloud\ServiceDirectory\V1\ListEndpointsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the service whose endpoints you'd like to - * list. - * @type int $page_size - * Optional. The maximum number of items to return. - * @type string $page_token - * Optional. The next_page_token value returned from a previous List request, - * if any. - * @type string $filter - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `address`, `port`, or `annotations.` for - * map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `annotations.owner` returns endpoints that have a annotation with the - * key `owner`, this is the same as `annotations:owner` - * * `annotations.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that - * have `owner` in annotation key but value is not `sd` AND have - * key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoints, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * @type string $order_by - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows values: `name`, `address`, `port` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the service whose endpoints you'd like to - * list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The resource name of the service whose endpoints you'd like to - * list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `address`, `port`, or `annotations.` for - * map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `annotations.owner` returns endpoints that have a annotation with the - * key `owner`, this is the same as `annotations:owner` - * * `annotations.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that - * have `owner` in annotation key but value is not `sd` AND have - * key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoints, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `address`, `port`, or `annotations.` for - * map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `annotations.owner` returns endpoints that have a annotation with the - * key `owner`, this is the same as `annotations:owner` - * * `annotations.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that - * have `owner` in annotation key but value is not `sd` AND have - * key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoints, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows values: `name`, `address`, `port` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows values: `name`, `address`, `port` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListEndpointsResponse.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListEndpointsResponse.php deleted file mode 100644 index 152be5d2d97..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListEndpointsResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -google.cloud.servicedirectory.v1.ListEndpointsResponse - */ -class ListEndpointsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of endpoints. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; - */ - private $endpoints; - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ServiceDirectory\V1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $endpoints - * The list of endpoints. - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * The list of endpoints. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEndpoints() - { - return $this->endpoints; - } - - /** - * The list of endpoints. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; - * @param array<\Google\Cloud\ServiceDirectory\V1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEndpoints($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceDirectory\V1\Endpoint::class); - $this->endpoints = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListNamespacesRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListNamespacesRequest.php deleted file mode 100644 index 6ac230b09ec..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListNamespacesRequest.php +++ /dev/null @@ -1,339 +0,0 @@ -google.cloud.servicedirectory.v1.ListNamespacesRequest - */ -class ListNamespacesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the project and location whose namespaces - * you'd like to list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name` or `labels.` for map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `labels.owner` returns namespaces that have a label with the key - * `owner`, this is the same as `labels:owner` - * * `labels.owner=sd` returns namespaces that have key/value - * `owner=sd` - * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` - * returns namespaces that have name that is alphabetically later than the - * string, so "namespace-e" is returned but "namespace-a" is not - * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have - * `owner` in label key but value is not `sd` AND have key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that namespace - * doesn't have a field called "doesnotexist". Since the filter does not - * match any namespaces, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. The resource name of the project and location whose namespaces - * you'd like to list. Please see - * {@see RegistrationServiceClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\ServiceDirectory\V1\ListNamespacesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the project and location whose namespaces - * you'd like to list. - * @type int $page_size - * Optional. The maximum number of items to return. - * @type string $page_token - * Optional. The next_page_token value returned from a previous List request, - * if any. - * @type string $filter - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name` or `labels.` for map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `labels.owner` returns namespaces that have a label with the key - * `owner`, this is the same as `labels:owner` - * * `labels.owner=sd` returns namespaces that have key/value - * `owner=sd` - * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` - * returns namespaces that have name that is alphabetically later than the - * string, so "namespace-e" is returned but "namespace-a" is not - * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have - * `owner` in label key but value is not `sd` AND have key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that namespace - * doesn't have a field called "doesnotexist". Since the filter does not - * match any namespaces, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * @type string $order_by - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the project and location whose namespaces - * you'd like to list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The resource name of the project and location whose namespaces - * you'd like to list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name` or `labels.` for map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `labels.owner` returns namespaces that have a label with the key - * `owner`, this is the same as `labels:owner` - * * `labels.owner=sd` returns namespaces that have key/value - * `owner=sd` - * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` - * returns namespaces that have name that is alphabetically later than the - * string, so "namespace-e" is returned but "namespace-a" is not - * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have - * `owner` in label key but value is not `sd` AND have key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that namespace - * doesn't have a field called "doesnotexist". Since the filter does not - * match any namespaces, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name` or `labels.` for map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `labels.owner` returns namespaces that have a label with the key - * `owner`, this is the same as `labels:owner` - * * `labels.owner=sd` returns namespaces that have key/value - * `owner=sd` - * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` - * returns namespaces that have name that is alphabetically later than the - * string, so "namespace-e" is returned but "namespace-a" is not - * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have - * `owner` in label key but value is not `sd` AND have key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that namespace - * doesn't have a field called "doesnotexist". Since the filter does not - * match any namespaces, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListNamespacesResponse.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListNamespacesResponse.php deleted file mode 100644 index 46926f93463..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListNamespacesResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -google.cloud.servicedirectory.v1.ListNamespacesResponse - */ -class ListNamespacesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of namespaces. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; - */ - private $namespaces; - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ServiceDirectory\V1\PBNamespace>|\Google\Protobuf\Internal\RepeatedField $namespaces - * The list of namespaces. - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * The list of namespaces. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNamespaces() - { - return $this->namespaces; - } - - /** - * The list of namespaces. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; - * @param array<\Google\Cloud\ServiceDirectory\V1\PBNamespace>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNamespaces($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceDirectory\V1\PBNamespace::class); - $this->namespaces = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListServicesRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListServicesRequest.php deleted file mode 100644 index 03bf23b1191..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListServicesRequest.php +++ /dev/null @@ -1,347 +0,0 @@ -google.cloud.servicedirectory.v1.ListServicesRequest - */ -class ListServicesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the namespace whose services you'd - * like to list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name` or `annotations.` for map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `annotations.owner` returns services that have a annotation with the - * key `owner`, this is the same as `annotations:owner` - * * `annotations.protocol=gRPC` returns services that have key/value - * `protocol=gRPC` - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` - * returns services that have name that is alphabetically later than the - * string, so "service-e" is returned but "service-a" is not - * * `annotations.owner!=sd AND annotations.foo=bar` returns services that - * have `owner` in annotation key but value is not `sd` AND have - * key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that service - * doesn't have a field called "doesnotexist". Since the filter does not - * match any services, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. The resource name of the namespace whose services you'd - * like to list. Please see - * {@see RegistrationServiceClient::namespaceName()} for help formatting this field. - * - * @return \Google\Cloud\ServiceDirectory\V1\ListServicesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the namespace whose services you'd - * like to list. - * @type int $page_size - * Optional. The maximum number of items to return. - * @type string $page_token - * Optional. The next_page_token value returned from a previous List request, - * if any. - * @type string $filter - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name` or `annotations.` for map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `annotations.owner` returns services that have a annotation with the - * key `owner`, this is the same as `annotations:owner` - * * `annotations.protocol=gRPC` returns services that have key/value - * `protocol=gRPC` - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` - * returns services that have name that is alphabetically later than the - * string, so "service-e" is returned but "service-a" is not - * * `annotations.owner!=sd AND annotations.foo=bar` returns services that - * have `owner` in annotation key but value is not `sd` AND have - * key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that service - * doesn't have a field called "doesnotexist". Since the filter does not - * match any services, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * @type string $order_by - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the namespace whose services you'd - * like to list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The resource name of the namespace whose services you'd - * like to list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name` or `annotations.` for map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `annotations.owner` returns services that have a annotation with the - * key `owner`, this is the same as `annotations:owner` - * * `annotations.protocol=gRPC` returns services that have key/value - * `protocol=gRPC` - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` - * returns services that have name that is alphabetically later than the - * string, so "service-e" is returned but "service-a" is not - * * `annotations.owner!=sd AND annotations.foo=bar` returns services that - * have `owner` in annotation key but value is not `sd` AND have - * key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that service - * doesn't have a field called "doesnotexist". Since the filter does not - * match any services, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name` or `annotations.` for map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `annotations.owner` returns services that have a annotation with the - * key `owner`, this is the same as `annotations:owner` - * * `annotations.protocol=gRPC` returns services that have key/value - * `protocol=gRPC` - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` - * returns services that have name that is alphabetically later than the - * string, so "service-e" is returned but "service-a" is not - * * `annotations.owner!=sd AND annotations.foo=bar` returns services that - * have `owner` in annotation key but value is not `sd` AND have - * key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that service - * doesn't have a field called "doesnotexist". Since the filter does not - * match any services, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListServicesResponse.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListServicesResponse.php deleted file mode 100644 index b0956b8c2b2..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ListServicesResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -google.cloud.servicedirectory.v1.ListServicesResponse - */ -class ListServicesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of services. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Service services = 1; - */ - private $services; - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ServiceDirectory\V1\Service>|\Google\Protobuf\Internal\RepeatedField $services - * The list of services. - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * The list of services. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Service services = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getServices() - { - return $this->services; - } - - /** - * The list of services. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Service services = 1; - * @param array<\Google\Cloud\ServiceDirectory\V1\Service>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setServices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceDirectory\V1\Service::class); - $this->services = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/PBNamespace.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/PBNamespace.php deleted file mode 100644 index d2fa30c5d03..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/PBNamespace.php +++ /dev/null @@ -1,153 +0,0 @@ -google.cloud.servicedirectory.v1.Namespace - */ -class PBNamespace extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The resource name for the namespace in the format - * `projects/*/locations/*/namespaces/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Optional. Resource labels associated with this namespace. - * No more than 64 user labels can be associated with a given resource. Label - * keys and values can be no longer than 63 characters. - * - * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Output only. The globally unique identifier of the namespace in the UUID4 - * format. - * - * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The resource name for the namespace in the format - * `projects/*/locations/*/namespaces/*`. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. Resource labels associated with this namespace. - * No more than 64 user labels can be associated with a given resource. Label - * keys and values can be no longer than 63 characters. - * @type string $uid - * Output only. The globally unique identifier of the namespace in the UUID4 - * format. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\PBNamespace::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The resource name for the namespace in the format - * `projects/*/locations/*/namespaces/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The resource name for the namespace in the format - * `projects/*/locations/*/namespaces/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. Resource labels associated with this namespace. - * No more than 64 user labels can be associated with a given resource. Label - * keys and values can be no longer than 63 characters. - * - * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. Resource labels associated with this namespace. - * No more than 64 user labels can be associated with a given resource. Label - * keys and values can be no longer than 63 characters. - * - * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Output only. The globally unique identifier of the namespace in the UUID4 - * format. - * - * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The globally unique identifier of the namespace in the UUID4 - * format. - * - * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ResolveServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ResolveServiceRequest.php deleted file mode 100644 index 8ce1366ea90..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ResolveServiceRequest.php +++ /dev/null @@ -1,265 +0,0 @@ -google.cloud.servicedirectory.v1.ResolveServiceRequest - */ -class ResolveServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the service to resolve. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. The maximum number of endpoints to return. Defaults to 25. - * Maximum is 100. If a value less than one is specified, the Default is used. - * If a value greater than the Maximum is specified, the Maximum is used. - * - * Generated from protobuf field int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $max_endpoints = 0; - /** - * Optional. The filter applied to the endpoints of the resolved service. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `address`, `port`, or `annotations.` for - * map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `annotations.owner` returns endpoints that have a annotation with the - * key `owner`, this is the same as `annotations:owner` - * * `annotations.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * - * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` - * returns the endpoint that has an endpoint_id equal to `ep-1` - * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that - * have `owner` in annotation key but value is not `sd` AND have - * key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoint, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $endpoint_filter = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the service to resolve. - * @type int $max_endpoints - * Optional. The maximum number of endpoints to return. Defaults to 25. - * Maximum is 100. If a value less than one is specified, the Default is used. - * If a value greater than the Maximum is specified, the Maximum is used. - * @type string $endpoint_filter - * Optional. The filter applied to the endpoints of the resolved service. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `address`, `port`, or `annotations.` for - * map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `annotations.owner` returns endpoints that have a annotation with the - * key `owner`, this is the same as `annotations:owner` - * * `annotations.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * - * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` - * returns the endpoint that has an endpoint_id equal to `ep-1` - * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that - * have `owner` in annotation key but value is not `sd` AND have - * key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoint, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\LookupService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the service to resolve. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the service to resolve. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. The maximum number of endpoints to return. Defaults to 25. - * Maximum is 100. If a value less than one is specified, the Default is used. - * If a value greater than the Maximum is specified, the Maximum is used. - * - * Generated from protobuf field int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getMaxEndpoints() - { - return $this->max_endpoints; - } - - /** - * Optional. The maximum number of endpoints to return. Defaults to 25. - * Maximum is 100. If a value less than one is specified, the Default is used. - * If a value greater than the Maximum is specified, the Maximum is used. - * - * Generated from protobuf field int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setMaxEndpoints($var) - { - GPBUtil::checkInt32($var); - $this->max_endpoints = $var; - - return $this; - } - - /** - * Optional. The filter applied to the endpoints of the resolved service. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `address`, `port`, or `annotations.` for - * map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `annotations.owner` returns endpoints that have a annotation with the - * key `owner`, this is the same as `annotations:owner` - * * `annotations.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * - * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` - * returns the endpoint that has an endpoint_id equal to `ep-1` - * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that - * have `owner` in annotation key but value is not `sd` AND have - * key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoint, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEndpointFilter() - { - return $this->endpoint_filter; - } - - /** - * Optional. The filter applied to the endpoints of the resolved service. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `address`, `port`, or `annotations.` for - * map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `annotations.owner` returns endpoints that have a annotation with the - * key `owner`, this is the same as `annotations:owner` - * * `annotations.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * - * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` - * returns the endpoint that has an endpoint_id equal to `ep-1` - * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that - * have `owner` in annotation key but value is not `sd` AND have - * key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoint, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEndpointFilter($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_filter = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ResolveServiceResponse.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ResolveServiceResponse.php deleted file mode 100644 index 63fa97718ca..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/ResolveServiceResponse.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.servicedirectory.v1.ResolveServiceResponse - */ -class ResolveServiceResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 1; - */ - protected $service = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ServiceDirectory\V1\Service $service - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\LookupService::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 1; - * @return \Google\Cloud\ServiceDirectory\V1\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 1; - * @param \Google\Cloud\ServiceDirectory\V1\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1\Service::class); - $this->service = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/Service.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/Service.php deleted file mode 100644 index 33f8d1b6b89..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/Service.php +++ /dev/null @@ -1,256 +0,0 @@ -google.cloud.servicedirectory.v1.Service - */ -class Service extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The resource name for the service in the format - * `projects/*/locations/*/namespaces/*/services/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Optional. Annotations for the service. This data can be consumed by service - * clients. - * Restrictions: - * * The entire annotations dictionary may contain up to 2000 characters, - * spread accoss all key-value pairs. Annotations that go beyond this - * limit are rejected - * * Valid annotation keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Annotations that fails to meet these requirements are rejected - * Note: This field is equivalent to the `metadata` field in the v1beta1 API. - * They have the same syntax and read/write to the same location in Service - * Directory. - * - * Generated from protobuf field map annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $annotations; - /** - * Output only. Endpoints associated with this service. Returned on - * [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService]. - * Control plane clients should use - * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints]. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $endpoints; - /** - * Output only. The globally unique identifier of the service in the UUID4 - * format. - * - * Generated from protobuf field string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The resource name for the service in the format - * `projects/*/locations/*/namespaces/*/services/*`. - * @type array|\Google\Protobuf\Internal\MapField $annotations - * Optional. Annotations for the service. This data can be consumed by service - * clients. - * Restrictions: - * * The entire annotations dictionary may contain up to 2000 characters, - * spread accoss all key-value pairs. Annotations that go beyond this - * limit are rejected - * * Valid annotation keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Annotations that fails to meet these requirements are rejected - * Note: This field is equivalent to the `metadata` field in the v1beta1 API. - * They have the same syntax and read/write to the same location in Service - * Directory. - * @type array<\Google\Cloud\ServiceDirectory\V1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $endpoints - * Output only. Endpoints associated with this service. Returned on - * [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService]. - * Control plane clients should use - * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints]. - * @type string $uid - * Output only. The globally unique identifier of the service in the UUID4 - * format. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The resource name for the service in the format - * `projects/*/locations/*/namespaces/*/services/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The resource name for the service in the format - * `projects/*/locations/*/namespaces/*/services/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. Annotations for the service. This data can be consumed by service - * clients. - * Restrictions: - * * The entire annotations dictionary may contain up to 2000 characters, - * spread accoss all key-value pairs. Annotations that go beyond this - * limit are rejected - * * Valid annotation keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Annotations that fails to meet these requirements are rejected - * Note: This field is equivalent to the `metadata` field in the v1beta1 API. - * They have the same syntax and read/write to the same location in Service - * Directory. - * - * Generated from protobuf field map annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * Optional. Annotations for the service. This data can be consumed by service - * clients. - * Restrictions: - * * The entire annotations dictionary may contain up to 2000 characters, - * spread accoss all key-value pairs. Annotations that go beyond this - * limit are rejected - * * Valid annotation keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Annotations that fails to meet these requirements are rejected - * Note: This field is equivalent to the `metadata` field in the v1beta1 API. - * They have the same syntax and read/write to the same location in Service - * Directory. - * - * Generated from protobuf field map annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Output only. Endpoints associated with this service. Returned on - * [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService]. - * Control plane clients should use - * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints]. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEndpoints() - { - return $this->endpoints; - } - - /** - * Output only. Endpoints associated with this service. Returned on - * [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService]. - * Control plane clients should use - * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints]. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\ServiceDirectory\V1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEndpoints($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceDirectory\V1\Endpoint::class); - $this->endpoints = $arr; - - return $this; - } - - /** - * Output only. The globally unique identifier of the service in the UUID4 - * format. - * - * Generated from protobuf field string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The globally unique identifier of the service in the UUID4 - * format. - * - * Generated from protobuf field string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateEndpointRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateEndpointRequest.php deleted file mode 100644 index 6c294424f3f..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateEndpointRequest.php +++ /dev/null @@ -1,137 +0,0 @@ -google.cloud.servicedirectory.v1.UpdateEndpointRequest - */ -class UpdateEndpointRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The updated endpoint. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $endpoint = null; - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\ServiceDirectory\V1\Endpoint $endpoint Required. The updated endpoint. - * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields to be updated in this request. - * - * @return \Google\Cloud\ServiceDirectory\V1\UpdateEndpointRequest - * - * @experimental - */ - public static function build(\Google\Cloud\ServiceDirectory\V1\Endpoint $endpoint, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setEndpoint($endpoint) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ServiceDirectory\V1\Endpoint $endpoint - * Required. The updated endpoint. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. List of fields to be updated in this request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The updated endpoint. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ServiceDirectory\V1\Endpoint|null - */ - public function getEndpoint() - { - return $this->endpoint; - } - - public function hasEndpoint() - { - return isset($this->endpoint); - } - - public function clearEndpoint() - { - unset($this->endpoint); - } - - /** - * Required. The updated endpoint. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ServiceDirectory\V1\Endpoint $var - * @return $this - */ - public function setEndpoint($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1\Endpoint::class); - $this->endpoint = $var; - - return $this; - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateNamespaceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateNamespaceRequest.php deleted file mode 100644 index 499e2528df7..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateNamespaceRequest.php +++ /dev/null @@ -1,137 +0,0 @@ -google.cloud.servicedirectory.v1.UpdateNamespaceRequest - */ -class UpdateNamespaceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The updated namespace. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $namespace = null; - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\ServiceDirectory\V1\PBNamespace $namespace Required. The updated namespace. - * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields to be updated in this request. - * - * @return \Google\Cloud\ServiceDirectory\V1\UpdateNamespaceRequest - * - * @experimental - */ - public static function build(\Google\Cloud\ServiceDirectory\V1\PBNamespace $namespace, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setNamespace($namespace) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ServiceDirectory\V1\PBNamespace $namespace - * Required. The updated namespace. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. List of fields to be updated in this request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The updated namespace. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ServiceDirectory\V1\PBNamespace|null - */ - public function getNamespace() - { - return $this->namespace; - } - - public function hasNamespace() - { - return isset($this->namespace); - } - - public function clearNamespace() - { - unset($this->namespace); - } - - /** - * Required. The updated namespace. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ServiceDirectory\V1\PBNamespace $var - * @return $this - */ - public function setNamespace($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1\PBNamespace::class); - $this->namespace = $var; - - return $this; - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateServiceRequest.php deleted file mode 100644 index b71bc24db98..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/proto/src/Google/Cloud/ServiceDirectory/V1/UpdateServiceRequest.php +++ /dev/null @@ -1,137 +0,0 @@ -google.cloud.servicedirectory.v1.UpdateServiceRequest - */ -class UpdateServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The updated service. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $service = null; - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\ServiceDirectory\V1\Service $service Required. The updated service. - * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields to be updated in this request. - * - * @return \Google\Cloud\ServiceDirectory\V1\UpdateServiceRequest - * - * @experimental - */ - public static function build(\Google\Cloud\ServiceDirectory\V1\Service $service, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setService($service) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ServiceDirectory\V1\Service $service - * Required. The updated service. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. List of fields to be updated in this request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The updated service. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ServiceDirectory\V1\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Required. The updated service. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ServiceDirectory\V1\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1\Service::class); - $this->service = $var; - - return $this; - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/resolve_service.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/resolve_service.php deleted file mode 100644 index f84de20cf94..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/LookupServiceClient/resolve_service.php +++ /dev/null @@ -1,73 +0,0 @@ -resolveService($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = LookupServiceClient::serviceName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]', - '[SERVICE]' - ); - - resolve_service_sample($formattedName); -} -// [END servicedirectory_v1_generated_LookupService_ResolveService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_endpoint.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_endpoint.php deleted file mode 100644 index 3fa08ba2044..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_endpoint.php +++ /dev/null @@ -1,82 +0,0 @@ -RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - */ -function create_endpoint_sample(string $formattedParent, string $endpointId): void -{ - // Create a client. - $registrationServiceClient = new RegistrationServiceClient(); - - // Prepare any non-scalar elements to be passed along with the request. - $endpoint = new Endpoint(); - - // Call the API and handle any network failures. - try { - /** @var Endpoint $response */ - $response = $registrationServiceClient->createEndpoint($formattedParent, $endpointId, $endpoint); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RegistrationServiceClient::serviceName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]', - '[SERVICE]' - ); - $endpointId = '[ENDPOINT_ID]'; - - create_endpoint_sample($formattedParent, $endpointId); -} -// [END servicedirectory_v1_generated_RegistrationService_CreateEndpoint_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_namespace.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_namespace.php deleted file mode 100644 index cc07f6be4d7..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_namespace.php +++ /dev/null @@ -1,78 +0,0 @@ -RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - */ -function create_namespace_sample(string $formattedParent, string $namespaceId): void -{ - // Create a client. - $registrationServiceClient = new RegistrationServiceClient(); - - // Prepare any non-scalar elements to be passed along with the request. - $namespace = new PBNamespace(); - - // Call the API and handle any network failures. - try { - /** @var PBNamespace $response */ - $response = $registrationServiceClient->createNamespace($formattedParent, $namespaceId, $namespace); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RegistrationServiceClient::locationName('[PROJECT]', '[LOCATION]'); - $namespaceId = '[NAMESPACE_ID]'; - - create_namespace_sample($formattedParent, $namespaceId); -} -// [END servicedirectory_v1_generated_RegistrationService_CreateNamespace_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_service.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_service.php deleted file mode 100644 index 45f6c1d1550..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/create_service.php +++ /dev/null @@ -1,81 +0,0 @@ -RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - */ -function create_service_sample(string $formattedParent, string $serviceId): void -{ - // Create a client. - $registrationServiceClient = new RegistrationServiceClient(); - - // Prepare any non-scalar elements to be passed along with the request. - $service = new Service(); - - // Call the API and handle any network failures. - try { - /** @var Service $response */ - $response = $registrationServiceClient->createService($formattedParent, $serviceId, $service); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RegistrationServiceClient::namespaceName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]' - ); - $serviceId = '[SERVICE_ID]'; - - create_service_sample($formattedParent, $serviceId); -} -// [END servicedirectory_v1_generated_RegistrationService_CreateService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_endpoint.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_endpoint.php deleted file mode 100644 index 41eb4fadeed..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_endpoint.php +++ /dev/null @@ -1,70 +0,0 @@ -deleteEndpoint($formattedName); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RegistrationServiceClient::endpointName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]', - '[SERVICE]', - '[ENDPOINT]' - ); - - delete_endpoint_sample($formattedName); -} -// [END servicedirectory_v1_generated_RegistrationService_DeleteEndpoint_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_namespace.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_namespace.php deleted file mode 100644 index 684802bf350..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_namespace.php +++ /dev/null @@ -1,65 +0,0 @@ -deleteNamespace($formattedName); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RegistrationServiceClient::namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - - delete_namespace_sample($formattedName); -} -// [END servicedirectory_v1_generated_RegistrationService_DeleteNamespace_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_service.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_service.php deleted file mode 100644 index 6c1561f74b8..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/delete_service.php +++ /dev/null @@ -1,70 +0,0 @@ -deleteService($formattedName); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RegistrationServiceClient::serviceName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]', - '[SERVICE]' - ); - - delete_service_sample($formattedName); -} -// [END servicedirectory_v1_generated_RegistrationService_DeleteService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_endpoint.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_endpoint.php deleted file mode 100644 index 5d05a0ab60d..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_endpoint.php +++ /dev/null @@ -1,72 +0,0 @@ -getEndpoint($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RegistrationServiceClient::endpointName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]', - '[SERVICE]', - '[ENDPOINT]' - ); - - get_endpoint_sample($formattedName); -} -// [END servicedirectory_v1_generated_RegistrationService_GetEndpoint_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_iam_policy.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_iam_policy.php deleted file mode 100644 index 6edc7638016..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_iam_policy.php +++ /dev/null @@ -1,66 +0,0 @@ -getIamPolicy($resource); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END servicedirectory_v1_generated_RegistrationService_GetIamPolicy_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_namespace.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_namespace.php deleted file mode 100644 index 331361a13a6..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_namespace.php +++ /dev/null @@ -1,66 +0,0 @@ -getNamespace($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RegistrationServiceClient::namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - - get_namespace_sample($formattedName); -} -// [END servicedirectory_v1_generated_RegistrationService_GetNamespace_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_service.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_service.php deleted file mode 100644 index d76a6a6013e..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/get_service.php +++ /dev/null @@ -1,71 +0,0 @@ -getService($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RegistrationServiceClient::serviceName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]', - '[SERVICE]' - ); - - get_service_sample($formattedName); -} -// [END servicedirectory_v1_generated_RegistrationService_GetService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_endpoints.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_endpoints.php deleted file mode 100644 index d3237893e81..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_endpoints.php +++ /dev/null @@ -1,77 +0,0 @@ -listEndpoints($formattedParent); - - /** @var Endpoint $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RegistrationServiceClient::serviceName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]', - '[SERVICE]' - ); - - list_endpoints_sample($formattedParent); -} -// [END servicedirectory_v1_generated_RegistrationService_ListEndpoints_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_namespaces.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_namespaces.php deleted file mode 100644 index 1e7cc3dc62d..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_namespaces.php +++ /dev/null @@ -1,72 +0,0 @@ -listNamespaces($formattedParent); - - /** @var PBNamespace $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RegistrationServiceClient::locationName('[PROJECT]', '[LOCATION]'); - - list_namespaces_sample($formattedParent); -} -// [END servicedirectory_v1_generated_RegistrationService_ListNamespaces_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_services.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_services.php deleted file mode 100644 index 645e7aac9ea..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/list_services.php +++ /dev/null @@ -1,76 +0,0 @@ -listServices($formattedParent); - - /** @var Service $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RegistrationServiceClient::namespaceName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]' - ); - - list_services_sample($formattedParent); -} -// [END servicedirectory_v1_generated_RegistrationService_ListServices_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/set_iam_policy.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/set_iam_policy.php deleted file mode 100644 index 0646528eb18..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/set_iam_policy.php +++ /dev/null @@ -1,69 +0,0 @@ -setIamPolicy($resource, $policy); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END servicedirectory_v1_generated_RegistrationService_SetIamPolicy_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/test_iam_permissions.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/test_iam_permissions.php deleted file mode 100644 index 04fc9f8e559..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/test_iam_permissions.php +++ /dev/null @@ -1,74 +0,0 @@ -testIamPermissions($resource, $permissions); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END servicedirectory_v1_generated_RegistrationService_TestIamPermissions_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_endpoint.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_endpoint.php deleted file mode 100644 index c517b9b17ee..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_endpoint.php +++ /dev/null @@ -1,58 +0,0 @@ -updateEndpoint($endpoint, $updateMask); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END servicedirectory_v1_generated_RegistrationService_UpdateEndpoint_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_namespace.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_namespace.php deleted file mode 100644 index 4a41b969f5d..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_namespace.php +++ /dev/null @@ -1,58 +0,0 @@ -updateNamespace($namespace, $updateMask); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END servicedirectory_v1_generated_RegistrationService_UpdateNamespace_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_service.php b/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_service.php deleted file mode 100644 index 609eef14e6f..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/samples/V1/RegistrationServiceClient/update_service.php +++ /dev/null @@ -1,58 +0,0 @@ -updateService($service, $updateMask); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END servicedirectory_v1_generated_RegistrationService_UpdateService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/BaseClient/LookupServiceBaseClient.php b/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/BaseClient/LookupServiceBaseClient.php deleted file mode 100644 index 12b15170c47..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/BaseClient/LookupServiceBaseClient.php +++ /dev/null @@ -1,296 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../../resources/lookup_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../../resources/lookup_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../../resources/lookup_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../../resources/lookup_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $namespace - * @param string $service - * - * @return string The formatted service resource. - */ - public static function serviceName(string $project, string $location, string $namespace, string $service): string - { - return self::getPathTemplate('service')->render([ - 'project' => $project, - 'location' => $location, - 'namespace' => $namespace, - 'service' => $service, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'servicedirectory.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Returns a [service][google.cloud.servicedirectory.v1.Service] and its - * associated endpoints. - * Resolving a service is not considered an active developer method. - * - * The async variant is {@see self::resolveServiceAsync()} . - * - * @param ResolveServiceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ResolveServiceResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function resolveService(ResolveServiceRequest $request, array $callOptions = []): ResolveServiceResponse - { - return $this->startApiCall('ResolveService', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see self::getLocationAsync()} . - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/BaseClient/RegistrationServiceBaseClient.php b/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/BaseClient/RegistrationServiceBaseClient.php deleted file mode 100644 index a5a368dd7bc..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/BaseClient/RegistrationServiceBaseClient.php +++ /dev/null @@ -1,830 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../../resources/registration_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../../resources/registration_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../../resources/registration_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../../resources/registration_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a endpoint - * resource. - * - * @param string $project - * @param string $location - * @param string $namespace - * @param string $service - * @param string $endpoint - * - * @return string The formatted endpoint resource. - */ - public static function endpointName(string $project, string $location, string $namespace, string $service, string $endpoint): string - { - return self::getPathTemplate('endpoint')->render([ - 'project' => $project, - 'location' => $location, - 'namespace' => $namespace, - 'service' => $service, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a namespace - * resource. - * - * @param string $project - * @param string $location - * @param string $namespace - * - * @return string The formatted namespace resource. - */ - public static function namespaceName(string $project, string $location, string $namespace): string - { - return self::getPathTemplate('namespace')->render([ - 'project' => $project, - 'location' => $location, - 'namespace' => $namespace, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - */ - public static function networkName(string $project, string $network): string - { - return self::getPathTemplate('network')->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $namespace - * @param string $service - * - * @return string The formatted service resource. - */ - public static function serviceName(string $project, string $location, string $namespace, string $service): string - { - return self::getPathTemplate('service')->render([ - 'project' => $project, - 'location' => $location, - 'namespace' => $namespace, - 'service' => $service, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - endpoint: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint} - * - location: projects/{project}/locations/{location} - * - namespace: projects/{project}/locations/{location}/namespaces/{namespace} - * - network: projects/{project}/locations/global/networks/{network} - * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'servicedirectory.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates an endpoint, and returns the new endpoint. - * - * The async variant is {@see self::createEndpointAsync()} . - * - * @param CreateEndpointRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Endpoint - * - * @throws ApiException Thrown if the API call fails. - */ - public function createEndpoint(CreateEndpointRequest $request, array $callOptions = []): Endpoint - { - return $this->startApiCall('CreateEndpoint', $request, $callOptions)->wait(); - } - - /** - * Creates a namespace, and returns the new namespace. - * - * The async variant is {@see self::createNamespaceAsync()} . - * - * @param CreateNamespaceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PBNamespace - * - * @throws ApiException Thrown if the API call fails. - */ - public function createNamespace(CreateNamespaceRequest $request, array $callOptions = []): PBNamespace - { - return $this->startApiCall('CreateNamespace', $request, $callOptions)->wait(); - } - - /** - * Creates a service, and returns the new service. - * - * The async variant is {@see self::createServiceAsync()} . - * - * @param CreateServiceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Service - * - * @throws ApiException Thrown if the API call fails. - */ - public function createService(CreateServiceRequest $request, array $callOptions = []): Service - { - return $this->startApiCall('CreateService', $request, $callOptions)->wait(); - } - - /** - * Deletes an endpoint. - * - * The async variant is {@see self::deleteEndpointAsync()} . - * - * @param DeleteEndpointRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteEndpoint(DeleteEndpointRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteEndpoint', $request, $callOptions)->wait(); - } - - /** - * Deletes a namespace. This also deletes all services and endpoints in - * the namespace. - * - * The async variant is {@see self::deleteNamespaceAsync()} . - * - * @param DeleteNamespaceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteNamespace(DeleteNamespaceRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteNamespace', $request, $callOptions)->wait(); - } - - /** - * Deletes a service. This also deletes all endpoints associated with - * the service. - * - * The async variant is {@see self::deleteServiceAsync()} . - * - * @param DeleteServiceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteService(DeleteServiceRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteService', $request, $callOptions)->wait(); - } - - /** - * Gets an endpoint. - * - * The async variant is {@see self::getEndpointAsync()} . - * - * @param GetEndpointRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Endpoint - * - * @throws ApiException Thrown if the API call fails. - */ - public function getEndpoint(GetEndpointRequest $request, array $callOptions = []): Endpoint - { - return $this->startApiCall('GetEndpoint', $request, $callOptions)->wait(); - } - - /** - * Gets the IAM Policy for a resource (namespace or service only). - * - * The async variant is {@see self::getIamPolicyAsync()} . - * - * @param GetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Gets a namespace. - * - * The async variant is {@see self::getNamespaceAsync()} . - * - * @param GetNamespaceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PBNamespace - * - * @throws ApiException Thrown if the API call fails. - */ - public function getNamespace(GetNamespaceRequest $request, array $callOptions = []): PBNamespace - { - return $this->startApiCall('GetNamespace', $request, $callOptions)->wait(); - } - - /** - * Gets a service. - * - * The async variant is {@see self::getServiceAsync()} . - * - * @param GetServiceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Service - * - * @throws ApiException Thrown if the API call fails. - */ - public function getService(GetServiceRequest $request, array $callOptions = []): Service - { - return $this->startApiCall('GetService', $request, $callOptions)->wait(); - } - - /** - * Lists all endpoints. - * - * The async variant is {@see self::listEndpointsAsync()} . - * - * @param ListEndpointsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listEndpoints(ListEndpointsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListEndpoints', $request, $callOptions); - } - - /** - * Lists all namespaces. - * - * The async variant is {@see self::listNamespacesAsync()} . - * - * @param ListNamespacesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listNamespaces(ListNamespacesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListNamespaces', $request, $callOptions); - } - - /** - * Lists all services belonging to a namespace. - * - * The async variant is {@see self::listServicesAsync()} . - * - * @param ListServicesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listServices(ListServicesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListServices', $request, $callOptions); - } - - /** - * Sets the IAM Policy for a resource (namespace or service only). - * - * The async variant is {@see self::setIamPolicyAsync()} . - * - * @param SetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Tests IAM permissions for a resource (namespace or service only). - * - * The async variant is {@see self::testIamPermissionsAsync()} . - * - * @param TestIamPermissionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return TestIamPermissionsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { - return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); - } - - /** - * Updates an endpoint. - * - * The async variant is {@see self::updateEndpointAsync()} . - * - * @param UpdateEndpointRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Endpoint - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateEndpoint(UpdateEndpointRequest $request, array $callOptions = []): Endpoint - { - return $this->startApiCall('UpdateEndpoint', $request, $callOptions)->wait(); - } - - /** - * Updates a namespace. - * - * The async variant is {@see self::updateNamespaceAsync()} . - * - * @param UpdateNamespaceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PBNamespace - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateNamespace(UpdateNamespaceRequest $request, array $callOptions = []): PBNamespace - { - return $this->startApiCall('UpdateNamespace', $request, $callOptions)->wait(); - } - - /** - * Updates a service. - * - * The async variant is {@see self::updateServiceAsync()} . - * - * @param UpdateServiceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Service - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateService(UpdateServiceRequest $request, array $callOptions = []): Service - { - return $this->startApiCall('UpdateService', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see self::getLocationAsync()} . - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/LookupServiceClient.php b/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/LookupServiceClient.php deleted file mode 100644 index 0b4dca5b04b..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/src/V1/Client/LookupServiceClient.php +++ /dev/null @@ -1,40 +0,0 @@ -serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - * $response = $lookupServiceClient->resolveService($formattedName); - * } finally { - * $lookupServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\ServiceDirectory\V1\Client\LookupServiceClient} to use the new - * surface. - */ -class LookupServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.servicedirectory.v1.LookupService'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'servicedirectory.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $serviceNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/lookup_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/lookup_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/lookup_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/lookup_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getServiceNameTemplate() - { - if (self::$serviceNameTemplate == null) { - self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}'); - } - - return self::$serviceNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'service' => self::getServiceNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $namespace - * @param string $service - * - * @return string The formatted service resource. - */ - public static function serviceName($project, $location, $namespace, $service) - { - return self::getServiceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'namespace' => $namespace, - 'service' => $service, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'servicedirectory.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Returns a [service][google.cloud.servicedirectory.v1.Service] and its - * associated endpoints. - * Resolving a service is not considered an active developer method. - * - * Sample code: - * ``` - * $lookupServiceClient = new LookupServiceClient(); - * try { - * $formattedName = $lookupServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - * $response = $lookupServiceClient->resolveService($formattedName); - * } finally { - * $lookupServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the service to resolve. - * @param array $optionalArgs { - * Optional. - * - * @type int $maxEndpoints - * Optional. The maximum number of endpoints to return. Defaults to 25. - * Maximum is 100. If a value less than one is specified, the Default is used. - * If a value greater than the Maximum is specified, the Maximum is used. - * @type string $endpointFilter - * Optional. The filter applied to the endpoints of the resolved service. - * - * General `filter` string syntax: - * ` ()` - * - * * `` can be `name`, `address`, `port`, or `annotations.` for - * map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * - * Examples of valid filters: - * - * * `annotations.owner` returns endpoints that have a annotation with the - * key `owner`, this is the same as `annotations:owner` - * * `annotations.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * - * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` - * returns the endpoint that has an endpoint_id equal to `ep-1` - * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that - * have `owner` in annotation key but value is not `sd` AND have - * key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoint, it returns no results - * - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1\ResolveServiceResponse - * - * @throws ApiException if the remote call fails - */ - public function resolveService($name, array $optionalArgs = []) - { - $request = new ResolveServiceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['maxEndpoints'])) { - $request->setMaxEndpoints($optionalArgs['maxEndpoints']); - } - - if (isset($optionalArgs['endpointFilter'])) { - $request->setEndpointFilter($optionalArgs['endpointFilter']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ResolveService', ResolveServiceResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $lookupServiceClient = new LookupServiceClient(); - * try { - * $response = $lookupServiceClient->getLocation(); - * } finally { - * $lookupServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $lookupServiceClient = new LookupServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $lookupServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $lookupServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $lookupServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/Gapic/RegistrationServiceGapicClient.php b/owl-bot-staging/ServiceDirectory/v1/src/V1/Gapic/RegistrationServiceGapicClient.php deleted file mode 100644 index 30974f7f8c1..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/src/V1/Gapic/RegistrationServiceGapicClient.php +++ /dev/null @@ -1,1561 +0,0 @@ -serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - * $endpointId = 'endpoint_id'; - * $endpoint = new Endpoint(); - * $response = $registrationServiceClient->createEndpoint($formattedParent, $endpointId, $endpoint); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\ServiceDirectory\V1\Client\RegistrationServiceClient} to use the - * new surface. - */ -class RegistrationServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.servicedirectory.v1.RegistrationService'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'servicedirectory.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $endpointNameTemplate; - - private static $locationNameTemplate; - - private static $namespaceNameTemplate; - - private static $networkNameTemplate; - - private static $serviceNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/registration_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/registration_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/registration_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/registration_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getEndpointNameTemplate() - { - if (self::$endpointNameTemplate == null) { - self::$endpointNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}'); - } - - return self::$endpointNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getNamespaceNameTemplate() - { - if (self::$namespaceNameTemplate == null) { - self::$namespaceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}'); - } - - return self::$namespaceNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate('projects/{project}/locations/global/networks/{network}'); - } - - return self::$networkNameTemplate; - } - - private static function getServiceNameTemplate() - { - if (self::$serviceNameTemplate == null) { - self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}'); - } - - return self::$serviceNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'endpoint' => self::getEndpointNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'namespace' => self::getNamespaceNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'service' => self::getServiceNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a endpoint - * resource. - * - * @param string $project - * @param string $location - * @param string $namespace - * @param string $service - * @param string $endpoint - * - * @return string The formatted endpoint resource. - */ - public static function endpointName($project, $location, $namespace, $service, $endpoint) - { - return self::getEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'namespace' => $namespace, - 'service' => $service, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a namespace - * resource. - * - * @param string $project - * @param string $location - * @param string $namespace - * - * @return string The formatted namespace resource. - */ - public static function namespaceName($project, $location, $namespace) - { - return self::getNamespaceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'namespace' => $namespace, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $namespace - * @param string $service - * - * @return string The formatted service resource. - */ - public static function serviceName($project, $location, $namespace, $service) - { - return self::getServiceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'namespace' => $namespace, - 'service' => $service, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - endpoint: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint} - * - location: projects/{project}/locations/{location} - * - namespace: projects/{project}/locations/{location}/namespaces/{namespace} - * - network: projects/{project}/locations/global/networks/{network} - * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'servicedirectory.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates an endpoint, and returns the new endpoint. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedParent = $registrationServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - * $endpointId = 'endpoint_id'; - * $endpoint = new Endpoint(); - * $response = $registrationServiceClient->createEndpoint($formattedParent, $endpointId, $endpoint); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the service that this endpoint provides. - * @param string $endpointId Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * @param Endpoint $endpoint Required. A endpoint with initial fields set. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1\Endpoint - * - * @throws ApiException if the remote call fails - */ - public function createEndpoint($parent, $endpointId, $endpoint, array $optionalArgs = []) - { - $request = new CreateEndpointRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEndpointId($endpointId); - $request->setEndpoint($endpoint); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateEndpoint', Endpoint::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a namespace, and returns the new namespace. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedParent = $registrationServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $namespaceId = 'namespace_id'; - * $namespace = new PBNamespace(); - * $response = $registrationServiceClient->createNamespace($formattedParent, $namespaceId, $namespace); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the project and location the namespace - * will be created in. - * @param string $namespaceId Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * @param PBNamespace $namespace Required. A namespace with initial fields set. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1\PBNamespace - * - * @throws ApiException if the remote call fails - */ - public function createNamespace($parent, $namespaceId, $namespace, array $optionalArgs = []) - { - $request = new CreateNamespaceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setNamespaceId($namespaceId); - $request->setNamespace($namespace); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateNamespace', PBNamespace::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a service, and returns the new service. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedParent = $registrationServiceClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - * $serviceId = 'service_id'; - * $service = new Service(); - * $response = $registrationServiceClient->createService($formattedParent, $serviceId, $service); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the namespace this service will belong to. - * @param string $serviceId Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * @param Service $service Required. A service with initial fields set. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1\Service - * - * @throws ApiException if the remote call fails - */ - public function createService($parent, $serviceId, $service, array $optionalArgs = []) - { - $request = new CreateServiceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setServiceId($serviceId); - $request->setService($service); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateService', Service::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes an endpoint. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedName = $registrationServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); - * $registrationServiceClient->deleteEndpoint($formattedName); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the endpoint to delete. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteEndpoint($name, array $optionalArgs = []) - { - $request = new DeleteEndpointRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteEndpoint', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a namespace. This also deletes all services and endpoints in - * the namespace. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedName = $registrationServiceClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - * $registrationServiceClient->deleteNamespace($formattedName); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the namespace to delete. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteNamespace($name, array $optionalArgs = []) - { - $request = new DeleteNamespaceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteNamespace', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a service. This also deletes all endpoints associated with - * the service. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedName = $registrationServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - * $registrationServiceClient->deleteService($formattedName); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the service to delete. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteService($name, array $optionalArgs = []) - { - $request = new DeleteServiceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteService', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets an endpoint. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedName = $registrationServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); - * $response = $registrationServiceClient->getEndpoint($formattedName); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the endpoint to get. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1\Endpoint - * - * @throws ApiException if the remote call fails - */ - public function getEndpoint($name, array $optionalArgs = []) - { - $request = new GetEndpointRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetEndpoint', Endpoint::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the IAM Policy for a resource (namespace or service only). - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $resource = 'resource'; - * $response = $registrationServiceClient->getIamPolicy($resource); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a namespace. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedName = $registrationServiceClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - * $response = $registrationServiceClient->getNamespace($formattedName); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the namespace to retrieve. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1\PBNamespace - * - * @throws ApiException if the remote call fails - */ - public function getNamespace($name, array $optionalArgs = []) - { - $request = new GetNamespaceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetNamespace', PBNamespace::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a service. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedName = $registrationServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - * $response = $registrationServiceClient->getService($formattedName); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the service to get. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1\Service - * - * @throws ApiException if the remote call fails - */ - public function getService($name, array $optionalArgs = []) - { - $request = new GetServiceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetService', Service::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists all endpoints. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedParent = $registrationServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - * // Iterate over pages of elements - * $pagedResponse = $registrationServiceClient->listEndpoints($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $registrationServiceClient->listEndpoints($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the service whose endpoints you'd like to - * list. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to list results by. - * - * General `filter` string syntax: - * ` ()` - * - * * `` can be `name`, `address`, `port`, or `annotations.` for - * map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * - * Examples of valid filters: - * - * * `annotations.owner` returns endpoints that have a annotation with the - * key `owner`, this is the same as `annotations:owner` - * * `annotations.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that - * have `owner` in annotation key but value is not `sd` AND have - * key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoints, it returns no results - * - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * @type string $orderBy - * Optional. The order to list results by. - * - * General `order_by` string syntax: ` () (,)` - * - * * `` allows values: `name`, `address`, `port` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listEndpoints($parent, array $optionalArgs = []) - { - $request = new ListEndpointsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListEndpoints', $optionalArgs, ListEndpointsResponse::class, $request); - } - - /** - * Lists all namespaces. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedParent = $registrationServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $registrationServiceClient->listNamespaces($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $registrationServiceClient->listNamespaces($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the project and location whose namespaces - * you'd like to list. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to list results by. - * - * General `filter` string syntax: - * ` ()` - * - * * `` can be `name` or `labels.` for map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * - * Examples of valid filters: - * - * * `labels.owner` returns namespaces that have a label with the key - * `owner`, this is the same as `labels:owner` - * * `labels.owner=sd` returns namespaces that have key/value - * `owner=sd` - * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` - * returns namespaces that have name that is alphabetically later than the - * string, so "namespace-e" is returned but "namespace-a" is not - * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have - * `owner` in label key but value is not `sd` AND have key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that namespace - * doesn't have a field called "doesnotexist". Since the filter does not - * match any namespaces, it returns no results - * - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * @type string $orderBy - * Optional. The order to list results by. - * - * General `order_by` string syntax: ` () (,)` - * - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listNamespaces($parent, array $optionalArgs = []) - { - $request = new ListNamespacesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListNamespaces', $optionalArgs, ListNamespacesResponse::class, $request); - } - - /** - * Lists all services belonging to a namespace. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedParent = $registrationServiceClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - * // Iterate over pages of elements - * $pagedResponse = $registrationServiceClient->listServices($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $registrationServiceClient->listServices($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the namespace whose services you'd - * like to list. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to list results by. - * - * General `filter` string syntax: - * ` ()` - * - * * `` can be `name` or `annotations.` for map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * - * Examples of valid filters: - * - * * `annotations.owner` returns services that have a annotation with the - * key `owner`, this is the same as `annotations:owner` - * * `annotations.protocol=gRPC` returns services that have key/value - * `protocol=gRPC` - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` - * returns services that have name that is alphabetically later than the - * string, so "service-e" is returned but "service-a" is not - * * `annotations.owner!=sd AND annotations.foo=bar` returns services that - * have `owner` in annotation key but value is not `sd` AND have - * key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that service - * doesn't have a field called "doesnotexist". Since the filter does not - * match any services, it returns no results - * - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * @type string $orderBy - * Optional. The order to list results by. - * - * General `order_by` string syntax: ` () (,)` - * - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listServices($parent, array $optionalArgs = []) - { - $request = new ListServicesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListServices', $optionalArgs, ListServicesResponse::class, $request); - } - - /** - * Sets the IAM Policy for a resource (namespace or service only). - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $registrationServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Tests IAM permissions for a resource (namespace or service only). - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $registrationServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $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[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates an endpoint. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $endpoint = new Endpoint(); - * $updateMask = new FieldMask(); - * $response = $registrationServiceClient->updateEndpoint($endpoint, $updateMask); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param Endpoint $endpoint Required. The updated endpoint. - * @param FieldMask $updateMask Required. List of fields to be updated in this request. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1\Endpoint - * - * @throws ApiException if the remote call fails - */ - public function updateEndpoint($endpoint, $updateMask, array $optionalArgs = []) - { - $request = new UpdateEndpointRequest(); - $requestParamHeaders = []; - $request->setEndpoint($endpoint); - $request->setUpdateMask($updateMask); - $requestParamHeaders['endpoint.name'] = $endpoint->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateEndpoint', Endpoint::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a namespace. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $namespace = new PBNamespace(); - * $updateMask = new FieldMask(); - * $response = $registrationServiceClient->updateNamespace($namespace, $updateMask); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param PBNamespace $namespace Required. The updated namespace. - * @param FieldMask $updateMask Required. List of fields to be updated in this request. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1\PBNamespace - * - * @throws ApiException if the remote call fails - */ - public function updateNamespace($namespace, $updateMask, array $optionalArgs = []) - { - $request = new UpdateNamespaceRequest(); - $requestParamHeaders = []; - $request->setNamespace($namespace); - $request->setUpdateMask($updateMask); - $requestParamHeaders['namespace.name'] = $namespace->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateNamespace', PBNamespace::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a service. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $service = new Service(); - * $updateMask = new FieldMask(); - * $response = $registrationServiceClient->updateService($service, $updateMask); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param Service $service Required. The updated service. - * @param FieldMask $updateMask Required. List of fields to be updated in this request. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1\Service - * - * @throws ApiException if the remote call fails - */ - public function updateService($service, $updateMask, array $optionalArgs = []) - { - $request = new UpdateServiceRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setUpdateMask($updateMask); - $requestParamHeaders['service.name'] = $service->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateService', Service::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $response = $registrationServiceClient->getLocation(); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $registrationServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $registrationServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/LookupServiceClient.php b/owl-bot-staging/ServiceDirectory/v1/src/V1/LookupServiceClient.php deleted file mode 100644 index b1ed13cc79b..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/src/V1/LookupServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ - [ - 'google.cloud.servicedirectory.v1.LookupService' => [ - 'ResolveService' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ServiceDirectory\V1\ResolveServiceResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'templateMap' => [ - 'service' => 'projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}', - ], - ], - ], -]; diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/lookup_service_rest_client_config.php b/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/lookup_service_rest_client_config.php deleted file mode 100644 index d4b279dd3b5..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/lookup_service_rest_client_config.php +++ /dev/null @@ -1,45 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.servicedirectory.v1.LookupService' => [ - 'ResolveService' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/namespaces/*/services/*}:resolve', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_client_config.json b/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_client_config.json deleted file mode 100644 index 2c5cb3b21d3..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_client_config.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "interfaces": { - "google.cloud.servicedirectory.v1.RegistrationService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE", - "UNKNOWN" - ] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 15000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 15000, - "total_timeout_millis": 15000 - } - }, - "methods": { - "CreateEndpoint": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "CreateNamespace": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "CreateService": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DeleteEndpoint": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DeleteNamespace": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DeleteService": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetEndpoint": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetNamespace": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetService": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListEndpoints": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListNamespaces": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListServices": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateEndpoint": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateNamespace": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateService": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetLocation": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListLocations": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_descriptor_config.php b/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_descriptor_config.php deleted file mode 100644 index 860ab2d79c1..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_descriptor_config.php +++ /dev/null @@ -1,292 +0,0 @@ - [ - 'google.cloud.servicedirectory.v1.RegistrationService' => [ - 'CreateEndpoint' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ServiceDirectory\V1\Endpoint', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateNamespace' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ServiceDirectory\V1\PBNamespace', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateService' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ServiceDirectory\V1\Service', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteEndpoint' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteNamespace' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteService' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetEndpoint' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ServiceDirectory\V1\Endpoint', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'GetNamespace' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ServiceDirectory\V1\PBNamespace', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetService' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ServiceDirectory\V1\Service', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListEndpoints' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getEndpoints', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\ServiceDirectory\V1\ListEndpointsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListNamespaces' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getNamespaces', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\ServiceDirectory\V1\ListNamespacesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListServices' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getServices', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\ServiceDirectory\V1\ListServicesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'UpdateEndpoint' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ServiceDirectory\V1\Endpoint', - 'headerParams' => [ - [ - 'keyName' => 'endpoint.name', - 'fieldAccessors' => [ - 'getEndpoint', - 'getName', - ], - ], - ], - ], - 'UpdateNamespace' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ServiceDirectory\V1\PBNamespace', - 'headerParams' => [ - [ - 'keyName' => 'namespace.name', - 'fieldAccessors' => [ - 'getNamespace', - 'getName', - ], - ], - ], - ], - 'UpdateService' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\ServiceDirectory\V1\Service', - 'headerParams' => [ - [ - 'keyName' => 'service.name', - 'fieldAccessors' => [ - 'getService', - 'getName', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'templateMap' => [ - 'endpoint' => 'projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}', - 'location' => 'projects/{project}/locations/{location}', - 'namespace' => 'projects/{project}/locations/{location}/namespaces/{namespace}', - 'network' => 'projects/{project}/locations/global/networks/{network}', - 'service' => 'projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}', - ], - ], - ], -]; diff --git a/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_rest_client_config.php b/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_rest_client_config.php deleted file mode 100644 index 9d81e0c9fc0..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/src/V1/resources/registration_service_rest_client_config.php +++ /dev/null @@ -1,282 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.servicedirectory.v1.RegistrationService' => [ - 'CreateEndpoint' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints', - 'body' => 'endpoint', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'endpoint_id', - ], - ], - 'CreateNamespace' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/namespaces', - 'body' => 'namespace', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'namespace_id', - ], - ], - 'CreateService' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/namespaces/*}/services', - 'body' => 'service', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'service_id', - ], - ], - 'DeleteEndpoint' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteNamespace' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/namespaces/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteService' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/namespaces/*/services/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetEndpoint' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/namespaces/*}:getIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:getIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'GetNamespace' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/namespaces/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetService' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/namespaces/*/services/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListEndpoints' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListNamespaces' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/namespaces', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListServices' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/namespaces/*}/services', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/namespaces/*}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/namespaces/*}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'UpdateEndpoint' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{endpoint.name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}', - 'body' => 'endpoint', - 'placeholders' => [ - 'endpoint.name' => [ - 'getters' => [ - 'getEndpoint', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - 'UpdateNamespace' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{namespace.name=projects/*/locations/*/namespaces/*}', - 'body' => 'namespace', - 'placeholders' => [ - 'namespace.name' => [ - 'getters' => [ - 'getNamespace', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - 'UpdateService' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{service.name=projects/*/locations/*/namespaces/*/services/*}', - 'body' => 'service', - 'placeholders' => [ - 'service.name' => [ - 'getters' => [ - 'getService', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/Client/LookupServiceClientTest.php b/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/Client/LookupServiceClientTest.php deleted file mode 100644 index 1a6ac45c617..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/Client/LookupServiceClientTest.php +++ /dev/null @@ -1,279 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return LookupServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new LookupServiceClient($options); - } - - /** @test */ - public function resolveServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ResolveServiceResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $request = (new ResolveServiceRequest()) - ->setName($formattedName); - $response = $gapicClient->resolveService($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.LookupService/ResolveService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resolveServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $request = (new ResolveServiceRequest()) - ->setName($formattedName); - try { - $gapicClient->resolveService($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resolveServiceAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ResolveServiceResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $request = (new ResolveServiceRequest()) - ->setName($formattedName); - $response = $gapicClient->resolveServiceAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.LookupService/ResolveService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/Client/RegistrationServiceClientTest.php b/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/Client/RegistrationServiceClientTest.php deleted file mode 100644 index 638c853ca08..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/Client/RegistrationServiceClientTest.php +++ /dev/null @@ -1,1532 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return RegistrationServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new RegistrationServiceClient($options); - } - - /** @test */ - public function createEndpointTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $address = 'address-1147692044'; - $port = 3446913; - $network = 'network1843485230'; - $uid = 'uid115792'; - $expectedResponse = new Endpoint(); - $expectedResponse->setName($name); - $expectedResponse->setAddress($address); - $expectedResponse->setPort($port); - $expectedResponse->setNetwork($network); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $endpointId = 'endpointId-1135808507'; - $endpoint = new Endpoint(); - $request = (new CreateEndpointRequest()) - ->setParent($formattedParent) - ->setEndpointId($endpointId) - ->setEndpoint($endpoint); - $response = $gapicClient->createEndpoint($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/CreateEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getEndpointId(); - $this->assertProtobufEquals($endpointId, $actualValue); - $actualValue = $actualRequestObject->getEndpoint(); - $this->assertProtobufEquals($endpoint, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createEndpointExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $endpointId = 'endpointId-1135808507'; - $endpoint = new Endpoint(); - $request = (new CreateEndpointRequest()) - ->setParent($formattedParent) - ->setEndpointId($endpointId) - ->setEndpoint($endpoint); - try { - $gapicClient->createEndpoint($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createNamespaceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $uid = 'uid115792'; - $expectedResponse = new PBNamespace(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $namespaceId = 'namespaceId-1253352833'; - $namespace = new PBNamespace(); - $request = (new CreateNamespaceRequest()) - ->setParent($formattedParent) - ->setNamespaceId($namespaceId) - ->setNamespace($namespace); - $response = $gapicClient->createNamespace($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/CreateNamespace', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getNamespaceId(); - $this->assertProtobufEquals($namespaceId, $actualValue); - $actualValue = $actualRequestObject->getNamespace(); - $this->assertProtobufEquals($namespace, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createNamespaceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $namespaceId = 'namespaceId-1253352833'; - $namespace = new PBNamespace(); - $request = (new CreateNamespaceRequest()) - ->setParent($formattedParent) - ->setNamespaceId($namespaceId) - ->setNamespace($namespace); - try { - $gapicClient->createNamespace($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - $request = (new CreateServiceRequest()) - ->setParent($formattedParent) - ->setServiceId($serviceId) - ->setService($service); - $response = $gapicClient->createService($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/CreateService', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getServiceId(); - $this->assertProtobufEquals($serviceId, $actualValue); - $actualValue = $actualRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - $request = (new CreateServiceRequest()) - ->setParent($formattedParent) - ->setServiceId($serviceId) - ->setService($service); - try { - $gapicClient->createService($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteEndpointTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); - $request = (new DeleteEndpointRequest()) - ->setName($formattedName); - $gapicClient->deleteEndpoint($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/DeleteEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteEndpointExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); - $request = (new DeleteEndpointRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteEndpoint($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteNamespaceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $request = (new DeleteNamespaceRequest()) - ->setName($formattedName); - $gapicClient->deleteNamespace($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/DeleteNamespace', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteNamespaceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $request = (new DeleteNamespaceRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteNamespace($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $request = (new DeleteServiceRequest()) - ->setName($formattedName); - $gapicClient->deleteService($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/DeleteService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $request = (new DeleteServiceRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteService($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEndpointTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $address = 'address-1147692044'; - $port = 3446913; - $network = 'network1843485230'; - $uid = 'uid115792'; - $expectedResponse = new Endpoint(); - $expectedResponse->setName($name2); - $expectedResponse->setAddress($address); - $expectedResponse->setPort($port); - $expectedResponse->setNetwork($network); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); - $request = (new GetEndpointRequest()) - ->setName($formattedName); - $response = $gapicClient->getEndpoint($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/GetEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEndpointExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); - $request = (new GetEndpointRequest()) - ->setName($formattedName); - try { - $gapicClient->getEndpoint($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - $response = $gapicClient->getIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - try { - $gapicClient->getIamPolicy($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getNamespaceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $expectedResponse = new PBNamespace(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $request = (new GetNamespaceRequest()) - ->setName($formattedName); - $response = $gapicClient->getNamespace($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/GetNamespace', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getNamespaceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $request = (new GetNamespaceRequest()) - ->setName($formattedName); - try { - $gapicClient->getNamespace($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $request = (new GetServiceRequest()) - ->setName($formattedName); - $response = $gapicClient->getService($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/GetService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $request = (new GetServiceRequest()) - ->setName($formattedName); - try { - $gapicClient->getService($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEndpointsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $endpointsElement = new Endpoint(); - $endpoints = [ - $endpointsElement, - ]; - $expectedResponse = new ListEndpointsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEndpoints($endpoints); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $request = (new ListEndpointsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listEndpoints($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEndpoints()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/ListEndpoints', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEndpointsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $request = (new ListEndpointsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listEndpoints($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listNamespacesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $namespacesElement = new PBNamespace(); - $namespaces = [ - $namespacesElement, - ]; - $expectedResponse = new ListNamespacesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setNamespaces($namespaces); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListNamespacesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listNamespaces($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getNamespaces()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/ListNamespaces', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listNamespacesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListNamespacesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listNamespaces($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listServicesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $servicesElement = new Service(); - $services = [ - $servicesElement, - ]; - $expectedResponse = new ListServicesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setServices($services); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $request = (new ListServicesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listServices($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/ListServices', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listServicesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $request = (new ListServicesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listServices($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - $response = $gapicClient->setIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - try { - $gapicClient->setIamPolicy($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - $response = $gapicClient->testIamPermissions($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - try { - $gapicClient->testIamPermissions($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateEndpointTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $address = 'address-1147692044'; - $port = 3446913; - $network = 'network1843485230'; - $uid = 'uid115792'; - $expectedResponse = new Endpoint(); - $expectedResponse->setName($name); - $expectedResponse->setAddress($address); - $expectedResponse->setPort($port); - $expectedResponse->setNetwork($network); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $endpoint = new Endpoint(); - $updateMask = new FieldMask(); - $request = (new UpdateEndpointRequest()) - ->setEndpoint($endpoint) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateEndpoint($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/UpdateEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getEndpoint(); - $this->assertProtobufEquals($endpoint, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateEndpointExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $endpoint = new Endpoint(); - $updateMask = new FieldMask(); - $request = (new UpdateEndpointRequest()) - ->setEndpoint($endpoint) - ->setUpdateMask($updateMask); - try { - $gapicClient->updateEndpoint($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateNamespaceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $uid = 'uid115792'; - $expectedResponse = new PBNamespace(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $namespace = new PBNamespace(); - $updateMask = new FieldMask(); - $request = (new UpdateNamespaceRequest()) - ->setNamespace($namespace) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateNamespace($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/UpdateNamespace', $actualFuncCall); - $actualValue = $actualRequestObject->getNamespace(); - $this->assertProtobufEquals($namespace, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateNamespaceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $namespace = new PBNamespace(); - $updateMask = new FieldMask(); - $request = (new UpdateNamespaceRequest()) - ->setNamespace($namespace) - ->setUpdateMask($updateMask); - try { - $gapicClient->updateNamespace($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $service = new Service(); - $updateMask = new FieldMask(); - $request = (new UpdateServiceRequest()) - ->setService($service) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateService($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/UpdateService', $actualFuncCall); - $actualValue = $actualRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $service = new Service(); - $updateMask = new FieldMask(); - $request = (new UpdateServiceRequest()) - ->setService($service) - ->setUpdateMask($updateMask); - try { - $gapicClient->updateService($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createEndpointAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $address = 'address-1147692044'; - $port = 3446913; - $network = 'network1843485230'; - $uid = 'uid115792'; - $expectedResponse = new Endpoint(); - $expectedResponse->setName($name); - $expectedResponse->setAddress($address); - $expectedResponse->setPort($port); - $expectedResponse->setNetwork($network); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $endpointId = 'endpointId-1135808507'; - $endpoint = new Endpoint(); - $request = (new CreateEndpointRequest()) - ->setParent($formattedParent) - ->setEndpointId($endpointId) - ->setEndpoint($endpoint); - $response = $gapicClient->createEndpointAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/CreateEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getEndpointId(); - $this->assertProtobufEquals($endpointId, $actualValue); - $actualValue = $actualRequestObject->getEndpoint(); - $this->assertProtobufEquals($endpoint, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/LookupServiceClientTest.php b/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/LookupServiceClientTest.php deleted file mode 100644 index 56def697a8e..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/LookupServiceClientTest.php +++ /dev/null @@ -1,241 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return LookupServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new LookupServiceClient($options); - } - - /** @test */ - public function resolveServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ResolveServiceResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $response = $gapicClient->resolveService($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.LookupService/ResolveService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resolveServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - try { - $gapicClient->resolveService($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/RegistrationServiceClientTest.php b/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/RegistrationServiceClientTest.php deleted file mode 100644 index 623027b4600..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1/tests/Unit/V1/RegistrationServiceClientTest.php +++ /dev/null @@ -1,1369 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return RegistrationServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new RegistrationServiceClient($options); - } - - /** @test */ - public function createEndpointTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $address = 'address-1147692044'; - $port = 3446913; - $network = 'network1843485230'; - $uid = 'uid115792'; - $expectedResponse = new Endpoint(); - $expectedResponse->setName($name); - $expectedResponse->setAddress($address); - $expectedResponse->setPort($port); - $expectedResponse->setNetwork($network); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $endpointId = 'endpointId-1135808507'; - $endpoint = new Endpoint(); - $response = $gapicClient->createEndpoint($formattedParent, $endpointId, $endpoint); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/CreateEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getEndpointId(); - $this->assertProtobufEquals($endpointId, $actualValue); - $actualValue = $actualRequestObject->getEndpoint(); - $this->assertProtobufEquals($endpoint, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createEndpointExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $endpointId = 'endpointId-1135808507'; - $endpoint = new Endpoint(); - try { - $gapicClient->createEndpoint($formattedParent, $endpointId, $endpoint); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createNamespaceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $uid = 'uid115792'; - $expectedResponse = new PBNamespace(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $namespaceId = 'namespaceId-1253352833'; - $namespace = new PBNamespace(); - $response = $gapicClient->createNamespace($formattedParent, $namespaceId, $namespace); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/CreateNamespace', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getNamespaceId(); - $this->assertProtobufEquals($namespaceId, $actualValue); - $actualValue = $actualRequestObject->getNamespace(); - $this->assertProtobufEquals($namespace, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createNamespaceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $namespaceId = 'namespaceId-1253352833'; - $namespace = new PBNamespace(); - try { - $gapicClient->createNamespace($formattedParent, $namespaceId, $namespace); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - $response = $gapicClient->createService($formattedParent, $serviceId, $service); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/CreateService', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getServiceId(); - $this->assertProtobufEquals($serviceId, $actualValue); - $actualValue = $actualRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - try { - $gapicClient->createService($formattedParent, $serviceId, $service); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteEndpointTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); - $gapicClient->deleteEndpoint($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/DeleteEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteEndpointExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); - try { - $gapicClient->deleteEndpoint($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteNamespaceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $gapicClient->deleteNamespace($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/DeleteNamespace', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteNamespaceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - try { - $gapicClient->deleteNamespace($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $gapicClient->deleteService($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/DeleteService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - try { - $gapicClient->deleteService($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEndpointTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $address = 'address-1147692044'; - $port = 3446913; - $network = 'network1843485230'; - $uid = 'uid115792'; - $expectedResponse = new Endpoint(); - $expectedResponse->setName($name2); - $expectedResponse->setAddress($address); - $expectedResponse->setPort($port); - $expectedResponse->setNetwork($network); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); - $response = $gapicClient->getEndpoint($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/GetEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEndpointExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); - try { - $gapicClient->getEndpoint($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getNamespaceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $expectedResponse = new PBNamespace(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $response = $gapicClient->getNamespace($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/GetNamespace', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getNamespaceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - try { - $gapicClient->getNamespace($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $response = $gapicClient->getService($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/GetService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - try { - $gapicClient->getService($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEndpointsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $endpointsElement = new Endpoint(); - $endpoints = [ - $endpointsElement, - ]; - $expectedResponse = new ListEndpointsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEndpoints($endpoints); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $response = $gapicClient->listEndpoints($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEndpoints()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/ListEndpoints', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEndpointsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - try { - $gapicClient->listEndpoints($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listNamespacesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $namespacesElement = new PBNamespace(); - $namespaces = [ - $namespacesElement, - ]; - $expectedResponse = new ListNamespacesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setNamespaces($namespaces); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listNamespaces($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getNamespaces()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/ListNamespaces', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listNamespacesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listNamespaces($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listServicesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $servicesElement = new Service(); - $services = [ - $servicesElement, - ]; - $expectedResponse = new ListServicesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setServices($services); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $response = $gapicClient->listServices($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/ListServices', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listServicesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - try { - $gapicClient->listServices($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateEndpointTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $address = 'address-1147692044'; - $port = 3446913; - $network = 'network1843485230'; - $uid = 'uid115792'; - $expectedResponse = new Endpoint(); - $expectedResponse->setName($name); - $expectedResponse->setAddress($address); - $expectedResponse->setPort($port); - $expectedResponse->setNetwork($network); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $endpoint = new Endpoint(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateEndpoint($endpoint, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/UpdateEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getEndpoint(); - $this->assertProtobufEquals($endpoint, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateEndpointExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $endpoint = new Endpoint(); - $updateMask = new FieldMask(); - try { - $gapicClient->updateEndpoint($endpoint, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateNamespaceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $uid = 'uid115792'; - $expectedResponse = new PBNamespace(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $namespace = new PBNamespace(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateNamespace($namespace, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/UpdateNamespace', $actualFuncCall); - $actualValue = $actualRequestObject->getNamespace(); - $this->assertProtobufEquals($namespace, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateNamespaceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $namespace = new PBNamespace(); - $updateMask = new FieldMask(); - try { - $gapicClient->updateNamespace($namespace, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $service = new Service(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateService($service, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1.RegistrationService/UpdateService', $actualFuncCall); - $actualValue = $actualRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $service = new Service(); - $updateMask = new FieldMask(); - try { - $gapicClient->updateService($service, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/Endpoint.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/Endpoint.php deleted file mode 100644 index 8194fe79c6f..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/Endpoint.php +++ /dev/null @@ -1,45 +0,0 @@ -internalAddGeneratedFile( - ' - -4google/cloud/servicedirectory/v1beta1/endpoint.proto%google.cloud.servicedirectory.v1beta1google/api/resource.protogoogle/protobuf/timestamp.proto" -Endpoint -name ( BA -address ( BA -port (BAT -metadata ( 2=.google.cloud.servicedirectory.v1beta1.Endpoint.MetadataEntryBA@ -network ( B/AA) -\'servicedirectory.googleapis.com/Network4 - create_time ( 2.google.protobuf.TimestampBA4 - update_time ( 2.google.protobuf.TimestampBA -uid ( BA/ - MetadataEntry -key (  -value ( :8:A -(servicedirectory.googleapis.com/Endpointfprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}B -)com.google.cloud.servicedirectory.v1beta1B EndpointProtoPZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb%Google.Cloud.ServiceDirectory.V1Beta1%Google\\Cloud\\ServiceDirectory\\V1beta1(Google::Cloud::ServiceDirectory::V1beta1Aa -\'servicedirectory.googleapis.com/Network6projects/{project}/locations/global/networks/{network}bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/LookupService.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/LookupService.php deleted file mode 100644 index b248278692a..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/LookupService.php +++ /dev/null @@ -1,41 +0,0 @@ -internalAddGeneratedFile( - ' - -:google/cloud/servicedirectory/v1beta1/lookup_service.proto%google.cloud.servicedirectory.v1beta1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto3google/cloud/servicedirectory/v1beta1/service.proto" -ResolveServiceRequest= -name ( B/AA) -\'servicedirectory.googleapis.com/Service - max_endpoints (BA -endpoint_filter ( BA"Y -ResolveServiceResponse? -service ( 2..google.cloud.servicedirectory.v1beta1.Service2 - LookupService -ResolveService<.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest=.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse"QK"F/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}:resolve:*SAservicedirectory.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB -)com.google.cloud.servicedirectory.v1beta1BLookupServiceProtoPZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb%Google.Cloud.ServiceDirectory.V1Beta1%Google\\Cloud\\ServiceDirectory\\V1beta1(Google::Cloud::ServiceDirectory::V1beta1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/PBNamespace.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/PBNamespace.php deleted file mode 100644 index d4a4c295b0c..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/PBNamespace.php +++ /dev/null @@ -1,40 +0,0 @@ -internalAddGeneratedFile( - ' - -5google/cloud/servicedirectory/v1beta1/namespace.proto%google.cloud.servicedirectory.v1beta1google/api/resource.protogoogle/protobuf/timestamp.proto" - Namespace -name ( BAQ -labels ( 2<.google.cloud.servicedirectory.v1beta1.Namespace.LabelsEntryBA4 - create_time ( 2.google.protobuf.TimestampBA4 - update_time ( 2.google.protobuf.TimestampBA -uid ( BA- - LabelsEntry -key (  -value ( :8:nAk -)servicedirectory.googleapis.com/Namespace>projects/{project}/locations/{location}/namespaces/{namespace}B -)com.google.cloud.servicedirectory.v1beta1BNamespaceProtoPZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb%Google.Cloud.ServiceDirectory.V1Beta1%Google\\Cloud\\ServiceDirectory\\V1beta1(Google::Cloud::ServiceDirectory::V1beta1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/RegistrationService.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/RegistrationService.php deleted file mode 100644 index 3428c4a76f4..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/RegistrationService.php +++ /dev/null @@ -1,135 +0,0 @@ -internalAddGeneratedFile( - ' -; -@google/cloud/servicedirectory/v1beta1/registration_service.proto%google.cloud.servicedirectory.v1beta1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto4google/cloud/servicedirectory/v1beta1/endpoint.proto5google/cloud/servicedirectory/v1beta1/namespace.proto3google/cloud/servicedirectory/v1beta1/service.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto" -CreateNamespaceRequest9 -parent ( B)AA# -!locations.googleapis.com/Location - namespace_id ( BAH - namespace ( 20.google.cloud.servicedirectory.v1beta1.NamespaceBA" -ListNamespacesRequest9 -parent ( B)AA# -!locations.googleapis.com/Location - page_size (BA - -page_token ( BA -filter ( BA -order_by ( BA"w -ListNamespacesResponseD - -namespaces ( 20.google.cloud.servicedirectory.v1beta1.Namespace -next_page_token ( "V -GetNamespaceRequest? -name ( B1AA+ -)servicedirectory.googleapis.com/Namespace" -UpdateNamespaceRequestH - namespace ( 20.google.cloud.servicedirectory.v1beta1.NamespaceBA4 - update_mask ( 2.google.protobuf.FieldMaskBA"Y -DeleteNamespaceRequest? -name ( B1AA+ -)servicedirectory.googleapis.com/Namespace" -CreateServiceRequestA -parent ( B1AA+ -)servicedirectory.googleapis.com/Namespace - -service_id ( BAD -service ( 2..google.cloud.servicedirectory.v1beta1.ServiceBA" -ListServicesRequestA -parent ( B1AA+ -)servicedirectory.googleapis.com/Namespace - page_size (BA - -page_token ( BA -filter ( BA -order_by ( BA"q -ListServicesResponse@ -services ( 2..google.cloud.servicedirectory.v1beta1.Service -next_page_token ( "R -GetServiceRequest= -name ( B/AA) -\'servicedirectory.googleapis.com/Service" -UpdateServiceRequestD -service ( 2..google.cloud.servicedirectory.v1beta1.ServiceBA4 - update_mask ( 2.google.protobuf.FieldMaskBA"U -DeleteServiceRequest= -name ( B/AA) -\'servicedirectory.googleapis.com/Service" -CreateEndpointRequest? -parent ( B/AA) -\'servicedirectory.googleapis.com/Service - endpoint_id ( BAF -endpoint ( 2/.google.cloud.servicedirectory.v1beta1.EndpointBA" -ListEndpointsRequest? -parent ( B/AA) -\'servicedirectory.googleapis.com/Service - page_size (BA - -page_token ( BA -filter ( BA -order_by ( BA"t -ListEndpointsResponseB - endpoints ( 2/.google.cloud.servicedirectory.v1beta1.Endpoint -next_page_token ( "T -GetEndpointRequest> -name ( B0AA* -(servicedirectory.googleapis.com/Endpoint" -UpdateEndpointRequestF -endpoint ( 2/.google.cloud.servicedirectory.v1beta1.EndpointBA4 - update_mask ( 2.google.protobuf.FieldMaskBA"W -DeleteEndpointRequest> -name ( B0AA* -(servicedirectory.googleapis.com/Endpoint2" -RegistrationService -CreateNamespace=.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest0.google.cloud.servicedirectory.v1beta1.Namespace"f@"3/v1beta1/{parent=projects/*/locations/*}/namespaces: namespaceAparent,namespace,namespace_id -ListNamespaces<.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest=.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse"D53/v1beta1/{parent=projects/*/locations/*}/namespacesAparent - GetNamespace:.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest0.google.cloud.servicedirectory.v1beta1.Namespace"B53/v1beta1/{name=projects/*/locations/*/namespaces/*}Aname -UpdateNamespace=.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest0.google.cloud.servicedirectory.v1beta1.Namespace"hJ2=/v1beta1/{namespace.name=projects/*/locations/*/namespaces/*}: namespaceAnamespace,update_mask -DeleteNamespace=.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest.google.protobuf.Empty"B5*3/v1beta1/{name=projects/*/locations/*/namespaces/*}Aname - CreateService;.google.cloud.servicedirectory.v1beta1.CreateServiceRequest..google.cloud.servicedirectory.v1beta1.Service"kI">/v1beta1/{parent=projects/*/locations/*/namespaces/*}/services:serviceAparent,service,service_id - ListServices:.google.cloud.servicedirectory.v1beta1.ListServicesRequest;.google.cloud.servicedirectory.v1beta1.ListServicesResponse"O@>/v1beta1/{parent=projects/*/locations/*/namespaces/*}/servicesAparent - -GetService8.google.cloud.servicedirectory.v1beta1.GetServiceRequest..google.cloud.servicedirectory.v1beta1.Service"M@>/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}Aname - UpdateService;.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest..google.cloud.servicedirectory.v1beta1.Service"mQ2F/v1beta1/{service.name=projects/*/locations/*/namespaces/*/services/*}:serviceAservice,update_mask - DeleteService;.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest.google.protobuf.Empty"M@*>/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}Aname -CreateEndpoint<.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest/.google.cloud.servicedirectory.v1beta1.Endpoint"zV"J/v1beta1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints:endpointAparent,endpoint,endpoint_id - ListEndpoints;.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest<.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse"[LJ/v1beta1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpointsAparent - GetEndpoint9.google.cloud.servicedirectory.v1beta1.GetEndpointRequest/.google.cloud.servicedirectory.v1beta1.Endpoint"YLJ/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}Aname -UpdateEndpoint<.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest/.google.cloud.servicedirectory.v1beta1.Endpoint"|_2S/v1beta1/{endpoint.name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}:endpointAendpoint,update_mask -DeleteEndpoint<.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest.google.protobuf.Empty"YL*J/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}Aname - GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy""D/v1beta1/{resource=projects/*/locations/*/namespaces/*}:getIamPolicy:*ZT"O/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:getIamPolicy:*ZU"P/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:getIamPolicy:* - SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy""D/v1beta1/{resource=projects/*/locations/*/namespaces/*}:setIamPolicy:*ZT"O/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:setIamPolicy:*ZU"P/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:setIamPolicy:* -TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse""J/v1beta1/{resource=projects/*/locations/*/namespaces/*}:testIamPermissions:*ZZ"U/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions:*Z["V/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:testIamPermissions:*SAservicedirectory.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB -)com.google.cloud.servicedirectory.v1beta1BRegistrationServiceProtoPZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb%Google.Cloud.ServiceDirectory.V1Beta1%Google\\Cloud\\ServiceDirectory\\V1beta1(Google::Cloud::ServiceDirectory::V1beta1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/Service.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/Service.php deleted file mode 100644 index 48ecd3cb74e..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/GPBMetadata/Google/Cloud/Servicedirectory/V1Beta1/Service.php +++ /dev/null @@ -1,42 +0,0 @@ -internalAddGeneratedFile( - ' - -3google/cloud/servicedirectory/v1beta1/service.proto%google.cloud.servicedirectory.v1beta1google/api/resource.proto4google/cloud/servicedirectory/v1beta1/endpoint.protogoogle/protobuf/timestamp.proto" -Service -name ( BAS -metadata ( 2<.google.cloud.servicedirectory.v1beta1.Service.MetadataEntryBAG - endpoints ( 2/.google.cloud.servicedirectory.v1beta1.EndpointBA4 - create_time ( 2.google.protobuf.TimestampBA4 - update_time ( 2.google.protobuf.TimestampBA -uid ( BA/ - MetadataEntry -key (  -value ( :8:A| -\'servicedirectory.googleapis.com/ServiceQprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}B -)com.google.cloud.servicedirectory.v1beta1B ServiceProtoPZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb%Google.Cloud.ServiceDirectory.V1Beta1%Google\\Cloud\\ServiceDirectory\\V1beta1(Google::Cloud::ServiceDirectory::V1beta1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateEndpointRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateEndpointRequest.php deleted file mode 100644 index 6b351f46162..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateEndpointRequest.php +++ /dev/null @@ -1,170 +0,0 @@ -google.cloud.servicedirectory.v1beta1.CreateEndpointRequest - */ -class CreateEndpointRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the service that this endpoint provides. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $endpoint_id = ''; - /** - * Required. A endpoint with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $endpoint = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the service that this endpoint provides. - * @type string $endpoint_id - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * @type \Google\Cloud\ServiceDirectory\V1beta1\Endpoint $endpoint - * Required. A endpoint with initial fields set. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the service that this endpoint provides. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The resource name of the service that this endpoint provides. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getEndpointId() - { - return $this->endpoint_id; - } - - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setEndpointId($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_id = $var; - - return $this; - } - - /** - * Required. A endpoint with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ServiceDirectory\V1beta1\Endpoint|null - */ - public function getEndpoint() - { - return $this->endpoint; - } - - public function hasEndpoint() - { - return isset($this->endpoint); - } - - public function clearEndpoint() - { - unset($this->endpoint); - } - - /** - * Required. A endpoint with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ServiceDirectory\V1beta1\Endpoint $var - * @return $this - */ - public function setEndpoint($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1beta1\Endpoint::class); - $this->endpoint = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateNamespaceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateNamespaceRequest.php deleted file mode 100644 index f44299101dc..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateNamespaceRequest.php +++ /dev/null @@ -1,174 +0,0 @@ -google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest - */ -class CreateNamespaceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the project and location the namespace - * will be created in. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $namespace_id = ''; - /** - * Required. A namespace with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $namespace = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the project and location the namespace - * will be created in. - * @type string $namespace_id - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * @type \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace $namespace - * Required. A namespace with initial fields set. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the project and location the namespace - * will be created in. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The resource name of the project and location the namespace - * will be created in. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getNamespaceId() - { - return $this->namespace_id; - } - - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setNamespaceId($var) - { - GPBUtil::checkString($var, True); - $this->namespace_id = $var; - - return $this; - } - - /** - * Required. A namespace with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace|null - */ - public function getNamespace() - { - return $this->namespace; - } - - public function hasNamespace() - { - return isset($this->namespace); - } - - public function clearNamespace() - { - unset($this->namespace); - } - - /** - * Required. A namespace with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace $var - * @return $this - */ - public function setNamespace($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace::class); - $this->namespace = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateServiceRequest.php deleted file mode 100644 index 30b20506c7e..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/CreateServiceRequest.php +++ /dev/null @@ -1,170 +0,0 @@ -google.cloud.servicedirectory.v1beta1.CreateServiceRequest - */ -class CreateServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the namespace this service will belong to. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $service_id = ''; - /** - * Required. A service with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $service = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the namespace this service will belong to. - * @type string $service_id - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * @type \Google\Cloud\ServiceDirectory\V1beta1\Service $service - * Required. A service with initial fields set. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the namespace this service will belong to. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The resource name of the namespace this service will belong to. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getServiceId() - { - return $this->service_id; - } - - /** - * Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setServiceId($var) - { - GPBUtil::checkString($var, True); - $this->service_id = $var; - - return $this; - } - - /** - * Required. A service with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ServiceDirectory\V1beta1\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Required. A service with initial fields set. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ServiceDirectory\V1beta1\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1beta1\Service::class); - $this->service = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteEndpointRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteEndpointRequest.php deleted file mode 100644 index 3f41216681a..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteEndpointRequest.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest - */ -class DeleteEndpointRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the endpoint to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the endpoint to delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the endpoint to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the endpoint to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteNamespaceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteNamespaceRequest.php deleted file mode 100644 index 02f9aed934a..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteNamespaceRequest.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest - */ -class DeleteNamespaceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the namespace to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the namespace to delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the namespace to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the namespace to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteServiceRequest.php deleted file mode 100644 index 1d04c1b981b..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/DeleteServiceRequest.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.servicedirectory.v1beta1.DeleteServiceRequest - */ -class DeleteServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the service to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the service to delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the service to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the service to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/Endpoint.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/Endpoint.php deleted file mode 100644 index e1677cb9a97..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/Endpoint.php +++ /dev/null @@ -1,447 +0,0 @@ -google.cloud.servicedirectory.v1beta1.Endpoint - */ -class Endpoint extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The resource name for the endpoint in the format - * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses - * like: - * * `8.8.8` - * * `8.8.8.8:53` - * * `test:bad:address` - * * `[::1]` - * * `[::1]:8080` - * Limited to 45 characters. - * - * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $address = ''; - /** - * Optional. Service Directory rejects values outside of `[0, 65535]`. - * - * Generated from protobuf field int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $port = 0; - /** - * Optional. Metadata for the endpoint. This data can be consumed by service - * clients. - * Restrictions: - * * The entire metadata dictionary may contain up to 512 characters, - * spread accoss all key-value pairs. Metadata that goes beyond this - * limit are rejected - * * Valid metadata keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Metadata that fails to meet these requirements are rejected - * Note: This field is equivalent to the `annotations` field in the v1 API. - * They have the same syntax and read/write to the same location in Service - * Directory. - * - * Generated from protobuf field map metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $metadata; - /** - * Immutable. The Google Compute Engine network (VPC) of the endpoint in the - * format `projects//locations/global/networks/*`. - * The project must be specified by project number (project id is rejected). - * Incorrectly formatted networks are rejected, but no other validation - * is performed on this field (ex. network or project existence, reachability, - * or permissions). - * - * Generated from protobuf field string network = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - */ - protected $network = ''; - /** - * Output only. The timestamp when the endpoint was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The timestamp when the endpoint was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. A globally unique identifier (in UUID4 format) for this - * endpoint. - * - * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The resource name for the endpoint in the format - * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - * @type string $address - * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses - * like: - * * `8.8.8` - * * `8.8.8.8:53` - * * `test:bad:address` - * * `[::1]` - * * `[::1]:8080` - * Limited to 45 characters. - * @type int $port - * Optional. Service Directory rejects values outside of `[0, 65535]`. - * @type array|\Google\Protobuf\Internal\MapField $metadata - * Optional. Metadata for the endpoint. This data can be consumed by service - * clients. - * Restrictions: - * * The entire metadata dictionary may contain up to 512 characters, - * spread accoss all key-value pairs. Metadata that goes beyond this - * limit are rejected - * * Valid metadata keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Metadata that fails to meet these requirements are rejected - * Note: This field is equivalent to the `annotations` field in the v1 API. - * They have the same syntax and read/write to the same location in Service - * Directory. - * @type string $network - * Immutable. The Google Compute Engine network (VPC) of the endpoint in the - * format `projects//locations/global/networks/*`. - * The project must be specified by project number (project id is rejected). - * Incorrectly formatted networks are rejected, but no other validation - * is performed on this field (ex. network or project existence, reachability, - * or permissions). - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The timestamp when the endpoint was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The timestamp when the endpoint was last updated. - * @type string $uid - * Output only. A globally unique identifier (in UUID4 format) for this - * endpoint. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\Endpoint::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The resource name for the endpoint in the format - * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The resource name for the endpoint in the format - * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses - * like: - * * `8.8.8` - * * `8.8.8.8:53` - * * `test:bad:address` - * * `[::1]` - * * `[::1]:8080` - * Limited to 45 characters. - * - * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAddress() - { - return $this->address; - } - - /** - * Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses - * like: - * * `8.8.8` - * * `8.8.8.8:53` - * * `test:bad:address` - * * `[::1]` - * * `[::1]:8080` - * Limited to 45 characters. - * - * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAddress($var) - { - GPBUtil::checkString($var, True); - $this->address = $var; - - return $this; - } - - /** - * Optional. Service Directory rejects values outside of `[0, 65535]`. - * - * Generated from protobuf field int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * Optional. Service Directory rejects values outside of `[0, 65535]`. - * - * Generated from protobuf field int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPort($var) - { - GPBUtil::checkInt32($var); - $this->port = $var; - - return $this; - } - - /** - * Optional. Metadata for the endpoint. This data can be consumed by service - * clients. - * Restrictions: - * * The entire metadata dictionary may contain up to 512 characters, - * spread accoss all key-value pairs. Metadata that goes beyond this - * limit are rejected - * * Valid metadata keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Metadata that fails to meet these requirements are rejected - * Note: This field is equivalent to the `annotations` field in the v1 API. - * They have the same syntax and read/write to the same location in Service - * Directory. - * - * Generated from protobuf field map metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getMetadata() - { - return $this->metadata; - } - - /** - * Optional. Metadata for the endpoint. This data can be consumed by service - * clients. - * Restrictions: - * * The entire metadata dictionary may contain up to 512 characters, - * spread accoss all key-value pairs. Metadata that goes beyond this - * limit are rejected - * * Valid metadata keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Metadata that fails to meet these requirements are rejected - * Note: This field is equivalent to the `annotations` field in the v1 API. - * They have the same syntax and read/write to the same location in Service - * Directory. - * - * Generated from protobuf field map metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->metadata = $arr; - - return $this; - } - - /** - * Immutable. The Google Compute Engine network (VPC) of the endpoint in the - * format `projects//locations/global/networks/*`. - * The project must be specified by project number (project id is rejected). - * Incorrectly formatted networks are rejected, but no other validation - * is performed on this field (ex. network or project existence, reachability, - * or permissions). - * - * Generated from protobuf field string network = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * Immutable. The Google Compute Engine network (VPC) of the endpoint in the - * format `projects//locations/global/networks/*`. - * The project must be specified by project number (project id is rejected). - * Incorrectly formatted networks are rejected, but no other validation - * is performed on this field (ex. network or project existence, reachability, - * or permissions). - * - * Generated from protobuf field string network = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * Output only. The timestamp when the endpoint was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The timestamp when the endpoint was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The timestamp when the endpoint was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The timestamp when the endpoint was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. A globally unique identifier (in UUID4 format) for this - * endpoint. - * - * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. A globally unique identifier (in UUID4 format) for this - * endpoint. - * - * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetEndpointRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetEndpointRequest.php deleted file mode 100644 index c4f895506d8..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetEndpointRequest.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.servicedirectory.v1beta1.GetEndpointRequest - */ -class GetEndpointRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the endpoint to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the endpoint to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the endpoint to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the endpoint to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetNamespaceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetNamespaceRequest.php deleted file mode 100644 index da3fb275998..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetNamespaceRequest.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.servicedirectory.v1beta1.GetNamespaceRequest - */ -class GetNamespaceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the namespace to retrieve. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the namespace to retrieve. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the namespace to retrieve. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the namespace to retrieve. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetServiceRequest.php deleted file mode 100644 index 5b792713890..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/GetServiceRequest.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.servicedirectory.v1beta1.GetServiceRequest - */ -class GetServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the service to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the service to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the service to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the service to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListEndpointsRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListEndpointsRequest.php deleted file mode 100644 index 656799a97ce..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListEndpointsRequest.php +++ /dev/null @@ -1,352 +0,0 @@ -google.cloud.servicedirectory.v1beta1.ListEndpointsRequest - */ -class ListEndpointsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the service whose endpoints you'd like to - * list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `address`, `port`, `metadata.` for map - * field, or `attributes.` for attributes field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `metadata.owner` returns endpoints that have a metadata with the key - * `owner`, this is the same as `metadata:owner` - * * `metadata.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have - * `owner` in metadata key but value is not `sd` AND have key/value - * `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoints, it returns no results - * * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ - * IP` returns endpoints with the corresponding kubernetes_resource_type - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows values: `name`, `address`, `port` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the service whose endpoints you'd like to - * list. - * @type int $page_size - * Optional. The maximum number of items to return. - * @type string $page_token - * Optional. The next_page_token value returned from a previous List request, - * if any. - * @type string $filter - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `address`, `port`, `metadata.` for map - * field, or `attributes.` for attributes field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `metadata.owner` returns endpoints that have a metadata with the key - * `owner`, this is the same as `metadata:owner` - * * `metadata.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have - * `owner` in metadata key but value is not `sd` AND have key/value - * `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoints, it returns no results - * * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ - * IP` returns endpoints with the corresponding kubernetes_resource_type - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * @type string $order_by - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows values: `name`, `address`, `port` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the service whose endpoints you'd like to - * list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The resource name of the service whose endpoints you'd like to - * list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `address`, `port`, `metadata.` for map - * field, or `attributes.` for attributes field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `metadata.owner` returns endpoints that have a metadata with the key - * `owner`, this is the same as `metadata:owner` - * * `metadata.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have - * `owner` in metadata key but value is not `sd` AND have key/value - * `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoints, it returns no results - * * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ - * IP` returns endpoints with the corresponding kubernetes_resource_type - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `address`, `port`, `metadata.` for map - * field, or `attributes.` for attributes field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `metadata.owner` returns endpoints that have a metadata with the key - * `owner`, this is the same as `metadata:owner` - * * `metadata.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have - * `owner` in metadata key but value is not `sd` AND have key/value - * `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoints, it returns no results - * * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ - * IP` returns endpoints with the corresponding kubernetes_resource_type - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows values: `name`, `address`, `port` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows values: `name`, `address`, `port` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListEndpointsResponse.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListEndpointsResponse.php deleted file mode 100644 index 11e79ca2bd7..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListEndpointsResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -google.cloud.servicedirectory.v1beta1.ListEndpointsResponse - */ -class ListEndpointsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of endpoints. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; - */ - private $endpoints; - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ServiceDirectory\V1beta1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $endpoints - * The list of endpoints. - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * The list of endpoints. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEndpoints() - { - return $this->endpoints; - } - - /** - * The list of endpoints. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; - * @param array<\Google\Cloud\ServiceDirectory\V1beta1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEndpoints($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceDirectory\V1beta1\Endpoint::class); - $this->endpoints = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListNamespacesRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListNamespacesRequest.php deleted file mode 100644 index 97662ebdf6d..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListNamespacesRequest.php +++ /dev/null @@ -1,332 +0,0 @@ -google.cloud.servicedirectory.v1beta1.ListNamespacesRequest - */ -class ListNamespacesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the project and location whose namespaces - * you'd like to list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `labels.` for map field, or - * `attributes.` for attributes field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `labels.owner` returns namespaces that have a label with the key - * `owner`, this is the same as `labels:owner` - * * `labels.owner=sd` returns namespaces that have key/value `owner=sd` - * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` - * returns namespaces that have name that is alphabetically later than the - * string, so "namespace-e" is returned but "namespace-a" is not - * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have - * `owner` in label key but value is not `sd` AND have key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that namespace - * doesn't have a field called "doesnotexist". Since the filter does not - * match any namespaces, it returns no results - * * `attributes.managed_registration=true` returns namespaces that are - * managed by a GCP product or service - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the project and location whose namespaces - * you'd like to list. - * @type int $page_size - * Optional. The maximum number of items to return. - * @type string $page_token - * Optional. The next_page_token value returned from a previous List request, - * if any. - * @type string $filter - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `labels.` for map field, or - * `attributes.` for attributes field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `labels.owner` returns namespaces that have a label with the key - * `owner`, this is the same as `labels:owner` - * * `labels.owner=sd` returns namespaces that have key/value `owner=sd` - * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` - * returns namespaces that have name that is alphabetically later than the - * string, so "namespace-e" is returned but "namespace-a" is not - * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have - * `owner` in label key but value is not `sd` AND have key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that namespace - * doesn't have a field called "doesnotexist". Since the filter does not - * match any namespaces, it returns no results - * * `attributes.managed_registration=true` returns namespaces that are - * managed by a GCP product or service - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * @type string $order_by - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the project and location whose namespaces - * you'd like to list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The resource name of the project and location whose namespaces - * you'd like to list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `labels.` for map field, or - * `attributes.` for attributes field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `labels.owner` returns namespaces that have a label with the key - * `owner`, this is the same as `labels:owner` - * * `labels.owner=sd` returns namespaces that have key/value `owner=sd` - * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` - * returns namespaces that have name that is alphabetically later than the - * string, so "namespace-e" is returned but "namespace-a" is not - * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have - * `owner` in label key but value is not `sd` AND have key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that namespace - * doesn't have a field called "doesnotexist". Since the filter does not - * match any namespaces, it returns no results - * * `attributes.managed_registration=true` returns namespaces that are - * managed by a GCP product or service - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `labels.` for map field, or - * `attributes.` for attributes field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `labels.owner` returns namespaces that have a label with the key - * `owner`, this is the same as `labels:owner` - * * `labels.owner=sd` returns namespaces that have key/value `owner=sd` - * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` - * returns namespaces that have name that is alphabetically later than the - * string, so "namespace-e" is returned but "namespace-a" is not - * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have - * `owner` in label key but value is not `sd` AND have key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that namespace - * doesn't have a field called "doesnotexist". Since the filter does not - * match any namespaces, it returns no results - * * `attributes.managed_registration=true` returns namespaces that are - * managed by a GCP product or service - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListNamespacesResponse.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListNamespacesResponse.php deleted file mode 100644 index 7490e2159ae..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListNamespacesResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -google.cloud.servicedirectory.v1beta1.ListNamespacesResponse - */ -class ListNamespacesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of namespaces. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; - */ - private $namespaces; - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ServiceDirectory\V1beta1\PBNamespace>|\Google\Protobuf\Internal\RepeatedField $namespaces - * The list of namespaces. - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * The list of namespaces. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNamespaces() - { - return $this->namespaces; - } - - /** - * The list of namespaces. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; - * @param array<\Google\Cloud\ServiceDirectory\V1beta1\PBNamespace>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNamespaces($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace::class); - $this->namespaces = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListServicesRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListServicesRequest.php deleted file mode 100644 index 3529638bf7a..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListServicesRequest.php +++ /dev/null @@ -1,344 +0,0 @@ -google.cloud.servicedirectory.v1beta1.ListServicesRequest - */ -class ListServicesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the namespace whose services you'd - * like to list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name` or `metadata.` for map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `metadata.owner` returns services that have a metadata with the key - * `owner`, this is the same as `metadata:owner` - * * `metadata.protocol=gRPC` returns services that have key/value - * `protocol=gRPC` - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` - * returns services that have name that is alphabetically later than the - * string, so "service-e" is returned but "service-a" is not - * * `metadata.owner!=sd AND metadata.foo=bar` returns services that have - * `owner` in metadata key but value is not `sd` AND have key/value - * `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that service - * doesn't have a field called "doesnotexist". Since the filter does not - * match any services, it returns no results - * * `attributes.managed_registration=true` returns services that are - * managed - * by a GCP product or service - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the namespace whose services you'd - * like to list. - * @type int $page_size - * Optional. The maximum number of items to return. - * @type string $page_token - * Optional. The next_page_token value returned from a previous List request, - * if any. - * @type string $filter - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name` or `metadata.` for map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `metadata.owner` returns services that have a metadata with the key - * `owner`, this is the same as `metadata:owner` - * * `metadata.protocol=gRPC` returns services that have key/value - * `protocol=gRPC` - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` - * returns services that have name that is alphabetically later than the - * string, so "service-e" is returned but "service-a" is not - * * `metadata.owner!=sd AND metadata.foo=bar` returns services that have - * `owner` in metadata key but value is not `sd` AND have key/value - * `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that service - * doesn't have a field called "doesnotexist". Since the filter does not - * match any services, it returns no results - * * `attributes.managed_registration=true` returns services that are - * managed - * by a GCP product or service - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * @type string $order_by - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the namespace whose services you'd - * like to list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The resource name of the namespace whose services you'd - * like to list. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of items to return. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The next_page_token value returned from a previous List request, - * if any. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name` or `metadata.` for map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `metadata.owner` returns services that have a metadata with the key - * `owner`, this is the same as `metadata:owner` - * * `metadata.protocol=gRPC` returns services that have key/value - * `protocol=gRPC` - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` - * returns services that have name that is alphabetically later than the - * string, so "service-e" is returned but "service-a" is not - * * `metadata.owner!=sd AND metadata.foo=bar` returns services that have - * `owner` in metadata key but value is not `sd` AND have key/value - * `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that service - * doesn't have a field called "doesnotexist". Since the filter does not - * match any services, it returns no results - * * `attributes.managed_registration=true` returns services that are - * managed - * by a GCP product or service - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to list results by. - * General `filter` string syntax: - * ` ()` - * * `` can be `name` or `metadata.` for map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `metadata.owner` returns services that have a metadata with the key - * `owner`, this is the same as `metadata:owner` - * * `metadata.protocol=gRPC` returns services that have key/value - * `protocol=gRPC` - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` - * returns services that have name that is alphabetically later than the - * string, so "service-e" is returned but "service-a" is not - * * `metadata.owner!=sd AND metadata.foo=bar` returns services that have - * `owner` in metadata key but value is not `sd` AND have key/value - * `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that service - * doesn't have a field called "doesnotexist". Since the filter does not - * match any services, it returns no results - * * `attributes.managed_registration=true` returns services that are - * managed - * by a GCP product or service - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. The order to list results by. - * General `order_by` string syntax: ` () (,)` - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListServicesResponse.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListServicesResponse.php deleted file mode 100644 index cbc3360635b..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ListServicesResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -google.cloud.servicedirectory.v1beta1.ListServicesResponse - */ -class ListServicesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of services. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; - */ - private $services; - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ServiceDirectory\V1beta1\Service>|\Google\Protobuf\Internal\RepeatedField $services - * The list of services. - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * The list of services. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getServices() - { - return $this->services; - } - - /** - * The list of services. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; - * @param array<\Google\Cloud\ServiceDirectory\V1beta1\Service>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setServices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceDirectory\V1beta1\Service::class); - $this->services = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/PBNamespace.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/PBNamespace.php deleted file mode 100644 index c12060ce211..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/PBNamespace.php +++ /dev/null @@ -1,241 +0,0 @@ -google.cloud.servicedirectory.v1beta1.Namespace - */ -class PBNamespace extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The resource name for the namespace in the format - * `projects/*/locations/*/namespaces/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Optional. Resource labels associated with this namespace. - * No more than 64 user labels can be associated with a given resource. Label - * keys and values can be no longer than 63 characters. - * - * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Output only. The timestamp when the namespace was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The timestamp when the namespace was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. A globally unique identifier (in UUID4 format) for this - * namespace. - * - * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The resource name for the namespace in the format - * `projects/*/locations/*/namespaces/*`. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. Resource labels associated with this namespace. - * No more than 64 user labels can be associated with a given resource. Label - * keys and values can be no longer than 63 characters. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The timestamp when the namespace was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The timestamp when the namespace was last updated. - * @type string $uid - * Output only. A globally unique identifier (in UUID4 format) for this - * namespace. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\PBNamespace::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The resource name for the namespace in the format - * `projects/*/locations/*/namespaces/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The resource name for the namespace in the format - * `projects/*/locations/*/namespaces/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. Resource labels associated with this namespace. - * No more than 64 user labels can be associated with a given resource. Label - * keys and values can be no longer than 63 characters. - * - * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. Resource labels associated with this namespace. - * No more than 64 user labels can be associated with a given resource. Label - * keys and values can be no longer than 63 characters. - * - * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Output only. The timestamp when the namespace was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The timestamp when the namespace was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The timestamp when the namespace was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The timestamp when the namespace was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. A globally unique identifier (in UUID4 format) for this - * namespace. - * - * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. A globally unique identifier (in UUID4 format) for this - * namespace. - * - * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ResolveServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ResolveServiceRequest.php deleted file mode 100644 index 2c3b93bcf5e..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ResolveServiceRequest.php +++ /dev/null @@ -1,265 +0,0 @@ -google.cloud.servicedirectory.v1beta1.ResolveServiceRequest - */ -class ResolveServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the service to resolve. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. The maximum number of endpoints to return. Defaults to 25. - * Maximum is 100. If a value less than one is specified, the Default is used. - * If a value greater than the Maximum is specified, the Maximum is used. - * - * Generated from protobuf field int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $max_endpoints = 0; - /** - * Optional. The filter applied to the endpoints of the resolved service. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `address`, `port`, or `metadata.` for - * map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `metadata.owner` returns endpoints that have a annotation with the key - * `owner`, this is the same as `metadata:owner` - * * `metadata.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * - * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` - * returns the endpoint that has an endpoint_id equal to `ep-1` - * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have - * `owner` in annotation key but value is not `sd` AND have key/value - * `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoint, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $endpoint_filter = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the service to resolve. - * @type int $max_endpoints - * Optional. The maximum number of endpoints to return. Defaults to 25. - * Maximum is 100. If a value less than one is specified, the Default is used. - * If a value greater than the Maximum is specified, the Maximum is used. - * @type string $endpoint_filter - * Optional. The filter applied to the endpoints of the resolved service. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `address`, `port`, or `metadata.` for - * map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `metadata.owner` returns endpoints that have a annotation with the key - * `owner`, this is the same as `metadata:owner` - * * `metadata.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * - * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` - * returns the endpoint that has an endpoint_id equal to `ep-1` - * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have - * `owner` in annotation key but value is not `sd` AND have key/value - * `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoint, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\LookupService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the service to resolve. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the service to resolve. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. The maximum number of endpoints to return. Defaults to 25. - * Maximum is 100. If a value less than one is specified, the Default is used. - * If a value greater than the Maximum is specified, the Maximum is used. - * - * Generated from protobuf field int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getMaxEndpoints() - { - return $this->max_endpoints; - } - - /** - * Optional. The maximum number of endpoints to return. Defaults to 25. - * Maximum is 100. If a value less than one is specified, the Default is used. - * If a value greater than the Maximum is specified, the Maximum is used. - * - * Generated from protobuf field int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setMaxEndpoints($var) - { - GPBUtil::checkInt32($var); - $this->max_endpoints = $var; - - return $this; - } - - /** - * Optional. The filter applied to the endpoints of the resolved service. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `address`, `port`, or `metadata.` for - * map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `metadata.owner` returns endpoints that have a annotation with the key - * `owner`, this is the same as `metadata:owner` - * * `metadata.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * - * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` - * returns the endpoint that has an endpoint_id equal to `ep-1` - * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have - * `owner` in annotation key but value is not `sd` AND have key/value - * `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoint, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEndpointFilter() - { - return $this->endpoint_filter; - } - - /** - * Optional. The filter applied to the endpoints of the resolved service. - * General `filter` string syntax: - * ` ()` - * * `` can be `name`, `address`, `port`, or `metadata.` for - * map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * Examples of valid filters: - * * `metadata.owner` returns endpoints that have a annotation with the key - * `owner`, this is the same as `metadata:owner` - * * `metadata.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * - * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` - * returns the endpoint that has an endpoint_id equal to `ep-1` - * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have - * `owner` in annotation key but value is not `sd` AND have key/value - * `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoint, it returns no results - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEndpointFilter($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_filter = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ResolveServiceResponse.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ResolveServiceResponse.php deleted file mode 100644 index b8f91d803a1..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/ResolveServiceResponse.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.servicedirectory.v1beta1.ResolveServiceResponse - */ -class ResolveServiceResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 1; - */ - protected $service = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ServiceDirectory\V1beta1\Service $service - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\LookupService::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 1; - * @return \Google\Cloud\ServiceDirectory\V1beta1\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 1; - * @param \Google\Cloud\ServiceDirectory\V1beta1\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1beta1\Service::class); - $this->service = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/Service.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/Service.php deleted file mode 100644 index 4f3b8f90a6f..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/Service.php +++ /dev/null @@ -1,352 +0,0 @@ -google.cloud.servicedirectory.v1beta1.Service - */ -class Service extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The resource name for the service in the format - * `projects/*/locations/*/namespaces/*/services/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Optional. Metadata for the service. This data can be consumed by service - * clients. - * Restrictions: - * * The entire metadata dictionary may contain up to 2000 characters, - * spread accoss all key-value pairs. Metadata that goes beyond this - * limit are rejected - * * Valid metadata keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Metadata that fails to meet these requirements are rejected - * Note: This field is equivalent to the `annotations` field in the v1 API. - * They have the same syntax and read/write to the same location in Service - * Directory. - * - * Generated from protobuf field map metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $metadata; - /** - * Output only. Endpoints associated with this service. Returned on - * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. - * Control plane clients should use - * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $endpoints; - /** - * Output only. The timestamp when the service was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The timestamp when the service was last updated. Note: - * endpoints being created/deleted/updated within the service are not - * considered service updates for the purpose of this timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. A globally unique identifier (in UUID4 format) for this - * service. - * - * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The resource name for the service in the format - * `projects/*/locations/*/namespaces/*/services/*`. - * @type array|\Google\Protobuf\Internal\MapField $metadata - * Optional. Metadata for the service. This data can be consumed by service - * clients. - * Restrictions: - * * The entire metadata dictionary may contain up to 2000 characters, - * spread accoss all key-value pairs. Metadata that goes beyond this - * limit are rejected - * * Valid metadata keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Metadata that fails to meet these requirements are rejected - * Note: This field is equivalent to the `annotations` field in the v1 API. - * They have the same syntax and read/write to the same location in Service - * Directory. - * @type array<\Google\Cloud\ServiceDirectory\V1beta1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $endpoints - * Output only. Endpoints associated with this service. Returned on - * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. - * Control plane clients should use - * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The timestamp when the service was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The timestamp when the service was last updated. Note: - * endpoints being created/deleted/updated within the service are not - * considered service updates for the purpose of this timestamp. - * @type string $uid - * Output only. A globally unique identifier (in UUID4 format) for this - * service. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The resource name for the service in the format - * `projects/*/locations/*/namespaces/*/services/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The resource name for the service in the format - * `projects/*/locations/*/namespaces/*/services/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. Metadata for the service. This data can be consumed by service - * clients. - * Restrictions: - * * The entire metadata dictionary may contain up to 2000 characters, - * spread accoss all key-value pairs. Metadata that goes beyond this - * limit are rejected - * * Valid metadata keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Metadata that fails to meet these requirements are rejected - * Note: This field is equivalent to the `annotations` field in the v1 API. - * They have the same syntax and read/write to the same location in Service - * Directory. - * - * Generated from protobuf field map metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getMetadata() - { - return $this->metadata; - } - - /** - * Optional. Metadata for the service. This data can be consumed by service - * clients. - * Restrictions: - * * The entire metadata dictionary may contain up to 2000 characters, - * spread accoss all key-value pairs. Metadata that goes beyond this - * limit are rejected - * * Valid metadata keys have two segments: an optional prefix and name, - * separated by a slash (/). The name segment is required and must be 63 - * characters or less, beginning and ending with an alphanumeric character - * ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - * alphanumerics between. The prefix is optional. If specified, the prefix - * must be a DNS subdomain: a series of DNS labels separated by dots (.), - * not longer than 253 characters in total, followed by a slash (/). - * Metadata that fails to meet these requirements are rejected - * Note: This field is equivalent to the `annotations` field in the v1 API. - * They have the same syntax and read/write to the same location in Service - * Directory. - * - * Generated from protobuf field map metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->metadata = $arr; - - return $this; - } - - /** - * Output only. Endpoints associated with this service. Returned on - * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. - * Control plane clients should use - * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEndpoints() - { - return $this->endpoints; - } - - /** - * Output only. Endpoints associated with this service. Returned on - * [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. - * Control plane clients should use - * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. - * - * Generated from protobuf field repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\ServiceDirectory\V1beta1\Endpoint>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEndpoints($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceDirectory\V1beta1\Endpoint::class); - $this->endpoints = $arr; - - return $this; - } - - /** - * Output only. The timestamp when the service was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The timestamp when the service was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The timestamp when the service was last updated. Note: - * endpoints being created/deleted/updated within the service are not - * considered service updates for the purpose of this timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The timestamp when the service was last updated. Note: - * endpoints being created/deleted/updated within the service are not - * considered service updates for the purpose of this timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. A globally unique identifier (in UUID4 format) for this - * service. - * - * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. A globally unique identifier (in UUID4 format) for this - * service. - * - * Generated from protobuf field string uid = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateEndpointRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateEndpointRequest.php deleted file mode 100644 index b89ff9379ef..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateEndpointRequest.php +++ /dev/null @@ -1,122 +0,0 @@ -google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest - */ -class UpdateEndpointRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The updated endpoint. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $endpoint = null; - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ServiceDirectory\V1beta1\Endpoint $endpoint - * Required. The updated endpoint. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. List of fields to be updated in this request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The updated endpoint. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ServiceDirectory\V1beta1\Endpoint|null - */ - public function getEndpoint() - { - return $this->endpoint; - } - - public function hasEndpoint() - { - return isset($this->endpoint); - } - - public function clearEndpoint() - { - unset($this->endpoint); - } - - /** - * Required. The updated endpoint. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ServiceDirectory\V1beta1\Endpoint $var - * @return $this - */ - public function setEndpoint($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1beta1\Endpoint::class); - $this->endpoint = $var; - - return $this; - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateNamespaceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateNamespaceRequest.php deleted file mode 100644 index 006337b95fe..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateNamespaceRequest.php +++ /dev/null @@ -1,122 +0,0 @@ -google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest - */ -class UpdateNamespaceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The updated namespace. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $namespace = null; - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace $namespace - * Required. The updated namespace. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. List of fields to be updated in this request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The updated namespace. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace|null - */ - public function getNamespace() - { - return $this->namespace; - } - - public function hasNamespace() - { - return isset($this->namespace); - } - - public function clearNamespace() - { - unset($this->namespace); - } - - /** - * Required. The updated namespace. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace $var - * @return $this - */ - public function setNamespace($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace::class); - $this->namespace = $var; - - return $this; - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateServiceRequest.php b/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateServiceRequest.php deleted file mode 100644 index bbbdfcaf1b5..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/proto/src/Google/Cloud/ServiceDirectory/V1beta1/UpdateServiceRequest.php +++ /dev/null @@ -1,122 +0,0 @@ -google.cloud.servicedirectory.v1beta1.UpdateServiceRequest - */ -class UpdateServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The updated service. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $service = null; - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ServiceDirectory\V1beta1\Service $service - * Required. The updated service. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. List of fields to be updated in this request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Servicedirectory\V1Beta1\RegistrationService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The updated service. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ServiceDirectory\V1beta1\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Required. The updated service. - * - * Generated from protobuf field .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ServiceDirectory\V1beta1\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1beta1\Service::class); - $this->service = $var; - - return $this; - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/resolve_service.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/resolve_service.php deleted file mode 100644 index b6b224d7c80..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/LookupServiceClient/resolve_service.php +++ /dev/null @@ -1,73 +0,0 @@ -resolveService($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = LookupServiceClient::serviceName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]', - '[SERVICE]' - ); - - resolve_service_sample($formattedName); -} -// [END servicedirectory_v1beta1_generated_LookupService_ResolveService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_endpoint.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_endpoint.php deleted file mode 100644 index 0a04289c651..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_endpoint.php +++ /dev/null @@ -1,82 +0,0 @@ -RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - */ -function create_endpoint_sample(string $formattedParent, string $endpointId): void -{ - // Create a client. - $registrationServiceClient = new RegistrationServiceClient(); - - // Prepare any non-scalar elements to be passed along with the request. - $endpoint = new Endpoint(); - - // Call the API and handle any network failures. - try { - /** @var Endpoint $response */ - $response = $registrationServiceClient->createEndpoint($formattedParent, $endpointId, $endpoint); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RegistrationServiceClient::serviceName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]', - '[SERVICE]' - ); - $endpointId = '[ENDPOINT_ID]'; - - create_endpoint_sample($formattedParent, $endpointId); -} -// [END servicedirectory_v1beta1_generated_RegistrationService_CreateEndpoint_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_namespace.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_namespace.php deleted file mode 100644 index e57cb91767a..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_namespace.php +++ /dev/null @@ -1,78 +0,0 @@ -RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - */ -function create_namespace_sample(string $formattedParent, string $namespaceId): void -{ - // Create a client. - $registrationServiceClient = new RegistrationServiceClient(); - - // Prepare any non-scalar elements to be passed along with the request. - $namespace = new PBNamespace(); - - // Call the API and handle any network failures. - try { - /** @var PBNamespace $response */ - $response = $registrationServiceClient->createNamespace($formattedParent, $namespaceId, $namespace); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RegistrationServiceClient::locationName('[PROJECT]', '[LOCATION]'); - $namespaceId = '[NAMESPACE_ID]'; - - create_namespace_sample($formattedParent, $namespaceId); -} -// [END servicedirectory_v1beta1_generated_RegistrationService_CreateNamespace_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_service.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_service.php deleted file mode 100644 index 1326f6ca08a..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/create_service.php +++ /dev/null @@ -1,81 +0,0 @@ -RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - */ -function create_service_sample(string $formattedParent, string $serviceId): void -{ - // Create a client. - $registrationServiceClient = new RegistrationServiceClient(); - - // Prepare any non-scalar elements to be passed along with the request. - $service = new Service(); - - // Call the API and handle any network failures. - try { - /** @var Service $response */ - $response = $registrationServiceClient->createService($formattedParent, $serviceId, $service); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RegistrationServiceClient::namespaceName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]' - ); - $serviceId = '[SERVICE_ID]'; - - create_service_sample($formattedParent, $serviceId); -} -// [END servicedirectory_v1beta1_generated_RegistrationService_CreateService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_endpoint.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_endpoint.php deleted file mode 100644 index 4f3c2ec3f64..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_endpoint.php +++ /dev/null @@ -1,70 +0,0 @@ -deleteEndpoint($formattedName); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RegistrationServiceClient::endpointName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]', - '[SERVICE]', - '[ENDPOINT]' - ); - - delete_endpoint_sample($formattedName); -} -// [END servicedirectory_v1beta1_generated_RegistrationService_DeleteEndpoint_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_namespace.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_namespace.php deleted file mode 100644 index cb8301c80a3..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_namespace.php +++ /dev/null @@ -1,65 +0,0 @@ -deleteNamespace($formattedName); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RegistrationServiceClient::namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - - delete_namespace_sample($formattedName); -} -// [END servicedirectory_v1beta1_generated_RegistrationService_DeleteNamespace_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_service.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_service.php deleted file mode 100644 index 6f4868df43d..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/delete_service.php +++ /dev/null @@ -1,70 +0,0 @@ -deleteService($formattedName); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RegistrationServiceClient::serviceName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]', - '[SERVICE]' - ); - - delete_service_sample($formattedName); -} -// [END servicedirectory_v1beta1_generated_RegistrationService_DeleteService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_endpoint.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_endpoint.php deleted file mode 100644 index 50f534f1c6b..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_endpoint.php +++ /dev/null @@ -1,72 +0,0 @@ -getEndpoint($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RegistrationServiceClient::endpointName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]', - '[SERVICE]', - '[ENDPOINT]' - ); - - get_endpoint_sample($formattedName); -} -// [END servicedirectory_v1beta1_generated_RegistrationService_GetEndpoint_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_iam_policy.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_iam_policy.php deleted file mode 100644 index a284240373f..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_iam_policy.php +++ /dev/null @@ -1,66 +0,0 @@ -getIamPolicy($resource); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END servicedirectory_v1beta1_generated_RegistrationService_GetIamPolicy_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_namespace.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_namespace.php deleted file mode 100644 index b7f8d5468e7..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_namespace.php +++ /dev/null @@ -1,66 +0,0 @@ -getNamespace($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RegistrationServiceClient::namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - - get_namespace_sample($formattedName); -} -// [END servicedirectory_v1beta1_generated_RegistrationService_GetNamespace_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_service.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_service.php deleted file mode 100644 index 5f9f44db352..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/get_service.php +++ /dev/null @@ -1,71 +0,0 @@ -getService($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = RegistrationServiceClient::serviceName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]', - '[SERVICE]' - ); - - get_service_sample($formattedName); -} -// [END servicedirectory_v1beta1_generated_RegistrationService_GetService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_endpoints.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_endpoints.php deleted file mode 100644 index fe8cab69c79..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_endpoints.php +++ /dev/null @@ -1,77 +0,0 @@ -listEndpoints($formattedParent); - - /** @var Endpoint $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RegistrationServiceClient::serviceName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]', - '[SERVICE]' - ); - - list_endpoints_sample($formattedParent); -} -// [END servicedirectory_v1beta1_generated_RegistrationService_ListEndpoints_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_namespaces.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_namespaces.php deleted file mode 100644 index 45fe7c550ee..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_namespaces.php +++ /dev/null @@ -1,72 +0,0 @@ -listNamespaces($formattedParent); - - /** @var PBNamespace $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RegistrationServiceClient::locationName('[PROJECT]', '[LOCATION]'); - - list_namespaces_sample($formattedParent); -} -// [END servicedirectory_v1beta1_generated_RegistrationService_ListNamespaces_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_services.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_services.php deleted file mode 100644 index 4ccebc036fc..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/list_services.php +++ /dev/null @@ -1,76 +0,0 @@ -listServices($formattedParent); - - /** @var Service $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = RegistrationServiceClient::namespaceName( - '[PROJECT]', - '[LOCATION]', - '[NAMESPACE]' - ); - - list_services_sample($formattedParent); -} -// [END servicedirectory_v1beta1_generated_RegistrationService_ListServices_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/set_iam_policy.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/set_iam_policy.php deleted file mode 100644 index cad3df911fa..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/set_iam_policy.php +++ /dev/null @@ -1,69 +0,0 @@ -setIamPolicy($resource, $policy); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END servicedirectory_v1beta1_generated_RegistrationService_SetIamPolicy_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/test_iam_permissions.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/test_iam_permissions.php deleted file mode 100644 index d44f3bffa8c..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/test_iam_permissions.php +++ /dev/null @@ -1,75 +0,0 @@ -testIamPermissions($resource, $permissions); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample 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. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END servicedirectory_v1beta1_generated_RegistrationService_TestIamPermissions_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_endpoint.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_endpoint.php deleted file mode 100644 index f1b42b1d111..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_endpoint.php +++ /dev/null @@ -1,58 +0,0 @@ -updateEndpoint($endpoint, $updateMask); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END servicedirectory_v1beta1_generated_RegistrationService_UpdateEndpoint_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_namespace.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_namespace.php deleted file mode 100644 index 72578814fac..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_namespace.php +++ /dev/null @@ -1,58 +0,0 @@ -updateNamespace($namespace, $updateMask); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END servicedirectory_v1beta1_generated_RegistrationService_UpdateNamespace_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_service.php b/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_service.php deleted file mode 100644 index 2080e4dfa2a..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/samples/V1beta1/RegistrationServiceClient/update_service.php +++ /dev/null @@ -1,58 +0,0 @@ -updateService($service, $updateMask); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END servicedirectory_v1beta1_generated_RegistrationService_UpdateService_sync] diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/Gapic/LookupServiceGapicClient.php b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/Gapic/LookupServiceGapicClient.php deleted file mode 100644 index 3ade4fdee34..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/Gapic/LookupServiceGapicClient.php +++ /dev/null @@ -1,475 +0,0 @@ -serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - * $response = $lookupServiceClient->resolveService($formattedName); - * } finally { - * $lookupServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - */ -class LookupServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.servicedirectory.v1beta1.LookupService'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'servicedirectory.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $serviceNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/lookup_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/lookup_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/lookup_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/lookup_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getServiceNameTemplate() - { - if (self::$serviceNameTemplate == null) { - self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}'); - } - - return self::$serviceNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'service' => self::getServiceNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $namespace - * @param string $service - * - * @return string The formatted service resource. - * - * @experimental - */ - public static function serviceName($project, $location, $namespace, $service) - { - return self::getServiceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'namespace' => $namespace, - 'service' => $service, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'servicedirectory.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Returns a [service][google.cloud.servicedirectory.v1beta1.Service] and its - * associated endpoints. - * Resolving a service is not considered an active developer method. - * - * Sample code: - * ``` - * $lookupServiceClient = new LookupServiceClient(); - * try { - * $formattedName = $lookupServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - * $response = $lookupServiceClient->resolveService($formattedName); - * } finally { - * $lookupServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the service to resolve. - * @param array $optionalArgs { - * Optional. - * - * @type int $maxEndpoints - * Optional. The maximum number of endpoints to return. Defaults to 25. - * Maximum is 100. If a value less than one is specified, the Default is used. - * If a value greater than the Maximum is specified, the Maximum is used. - * @type string $endpointFilter - * Optional. The filter applied to the endpoints of the resolved service. - * - * General `filter` string syntax: - * ` ()` - * - * * `` can be `name`, `address`, `port`, or `metadata.` for - * map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * - * Examples of valid filters: - * - * * `metadata.owner` returns endpoints that have a annotation with the key - * `owner`, this is the same as `metadata:owner` - * * `metadata.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * - * `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` - * returns the endpoint that has an endpoint_id equal to `ep-1` - * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have - * `owner` in annotation key but value is not `sd` AND have key/value - * `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoint, it returns no results - * - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1beta1\ResolveServiceResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function resolveService($name, array $optionalArgs = []) - { - $request = new ResolveServiceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['maxEndpoints'])) { - $request->setMaxEndpoints($optionalArgs['maxEndpoints']); - } - - if (isset($optionalArgs['endpointFilter'])) { - $request->setEndpointFilter($optionalArgs['endpointFilter']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ResolveService', ResolveServiceResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $lookupServiceClient = new LookupServiceClient(); - * try { - * $response = $lookupServiceClient->getLocation(); - * } finally { - * $lookupServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $lookupServiceClient = new LookupServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $lookupServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $lookupServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $lookupServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/Gapic/RegistrationServiceGapicClient.php b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/Gapic/RegistrationServiceGapicClient.php deleted file mode 100644 index 37d911510ca..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/Gapic/RegistrationServiceGapicClient.php +++ /dev/null @@ -1,1623 +0,0 @@ -serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - * $endpointId = 'endpoint_id'; - * $endpoint = new Endpoint(); - * $response = $registrationServiceClient->createEndpoint($formattedParent, $endpointId, $endpoint); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - */ -class RegistrationServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.servicedirectory.v1beta1.RegistrationService'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'servicedirectory.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $endpointNameTemplate; - - private static $locationNameTemplate; - - private static $namespaceNameTemplate; - - private static $networkNameTemplate; - - private static $serviceNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/registration_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/registration_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/registration_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/registration_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getEndpointNameTemplate() - { - if (self::$endpointNameTemplate == null) { - self::$endpointNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}'); - } - - return self::$endpointNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getNamespaceNameTemplate() - { - if (self::$namespaceNameTemplate == null) { - self::$namespaceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}'); - } - - return self::$namespaceNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate('projects/{project}/locations/global/networks/{network}'); - } - - return self::$networkNameTemplate; - } - - private static function getServiceNameTemplate() - { - if (self::$serviceNameTemplate == null) { - self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}'); - } - - return self::$serviceNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'endpoint' => self::getEndpointNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'namespace' => self::getNamespaceNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'service' => self::getServiceNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a endpoint - * resource. - * - * @param string $project - * @param string $location - * @param string $namespace - * @param string $service - * @param string $endpoint - * - * @return string The formatted endpoint resource. - * - * @experimental - */ - public static function endpointName($project, $location, $namespace, $service, $endpoint) - { - return self::getEndpointNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'namespace' => $namespace, - 'service' => $service, - 'endpoint' => $endpoint, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - * - * @experimental - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a namespace - * resource. - * - * @param string $project - * @param string $location - * @param string $namespace - * - * @return string The formatted namespace resource. - * - * @experimental - */ - public static function namespaceName($project, $location, $namespace) - { - return self::getNamespaceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'namespace' => $namespace, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - * - * @experimental - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $namespace - * @param string $service - * - * @return string The formatted service resource. - * - * @experimental - */ - public static function serviceName($project, $location, $namespace, $service) - { - return self::getServiceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'namespace' => $namespace, - 'service' => $service, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - endpoint: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint} - * - location: projects/{project}/locations/{location} - * - namespace: projects/{project}/locations/{location}/namespaces/{namespace} - * - network: projects/{project}/locations/global/networks/{network} - * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'servicedirectory.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates an endpoint, and returns the new endpoint. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedParent = $registrationServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - * $endpointId = 'endpoint_id'; - * $endpoint = new Endpoint(); - * $response = $registrationServiceClient->createEndpoint($formattedParent, $endpointId, $endpoint); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the service that this endpoint provides. - * @param string $endpointId Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * @param Endpoint $endpoint Required. A endpoint with initial fields set. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1beta1\Endpoint - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createEndpoint($parent, $endpointId, $endpoint, array $optionalArgs = []) - { - $request = new CreateEndpointRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEndpointId($endpointId); - $request->setEndpoint($endpoint); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateEndpoint', Endpoint::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a namespace, and returns the new namespace. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedParent = $registrationServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $namespaceId = 'namespace_id'; - * $namespace = new PBNamespace(); - * $response = $registrationServiceClient->createNamespace($formattedParent, $namespaceId, $namespace); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the project and location the namespace - * will be created in. - * @param string $namespaceId Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * @param PBNamespace $namespace Required. A namespace with initial fields set. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createNamespace($parent, $namespaceId, $namespace, array $optionalArgs = []) - { - $request = new CreateNamespaceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setNamespaceId($namespaceId); - $request->setNamespace($namespace); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateNamespace', PBNamespace::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a service, and returns the new service. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedParent = $registrationServiceClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - * $serviceId = 'service_id'; - * $service = new Service(); - * $response = $registrationServiceClient->createService($formattedParent, $serviceId, $service); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the namespace this service will belong to. - * @param string $serviceId Required. The Resource ID must be 1-63 characters long, and comply with - * RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must - * be a dash, lowercase letter, or digit, except the last character, which - * cannot be a dash. - * @param Service $service Required. A service with initial fields set. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1beta1\Service - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createService($parent, $serviceId, $service, array $optionalArgs = []) - { - $request = new CreateServiceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setServiceId($serviceId); - $request->setService($service); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateService', Service::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes an endpoint. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedName = $registrationServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); - * $registrationServiceClient->deleteEndpoint($formattedName); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the endpoint to delete. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteEndpoint($name, array $optionalArgs = []) - { - $request = new DeleteEndpointRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteEndpoint', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a namespace. This also deletes all services and endpoints in - * the namespace. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedName = $registrationServiceClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - * $registrationServiceClient->deleteNamespace($formattedName); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the namespace to delete. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteNamespace($name, array $optionalArgs = []) - { - $request = new DeleteNamespaceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteNamespace', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a service. This also deletes all endpoints associated with - * the service. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedName = $registrationServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - * $registrationServiceClient->deleteService($formattedName); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the service to delete. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteService($name, array $optionalArgs = []) - { - $request = new DeleteServiceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteService', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets an endpoint. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedName = $registrationServiceClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); - * $response = $registrationServiceClient->getEndpoint($formattedName); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the endpoint to get. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1beta1\Endpoint - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getEndpoint($name, array $optionalArgs = []) - { - $request = new GetEndpointRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetEndpoint', Endpoint::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the IAM Policy for a resource - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $resource = 'resource'; - * $response = $registrationServiceClient->getIamPolicy($resource); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a namespace. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedName = $registrationServiceClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - * $response = $registrationServiceClient->getNamespace($formattedName); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the namespace to retrieve. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getNamespace($name, array $optionalArgs = []) - { - $request = new GetNamespaceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetNamespace', PBNamespace::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a service. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedName = $registrationServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - * $response = $registrationServiceClient->getService($formattedName); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the service to get. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1beta1\Service - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getService($name, array $optionalArgs = []) - { - $request = new GetServiceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetService', Service::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists all endpoints. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedParent = $registrationServiceClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - * // Iterate over pages of elements - * $pagedResponse = $registrationServiceClient->listEndpoints($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $registrationServiceClient->listEndpoints($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the service whose endpoints you'd like to - * list. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to list results by. - * - * General `filter` string syntax: - * ` ()` - * - * * `` can be `name`, `address`, `port`, `metadata.` for map - * field, or `attributes.` for attributes field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * - * Examples of valid filters: - * - * * `metadata.owner` returns endpoints that have a metadata with the key - * `owner`, this is the same as `metadata:owner` - * * `metadata.protocol=gRPC` returns endpoints that have key/value - * `protocol=gRPC` - * * `address=192.108.1.105` returns endpoints that have this address - * * `port>8080` returns endpoints that have port number larger than 8080 - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - * returns endpoints that have name that is alphabetically later than the - * string, so "endpoint-e" is returned but "endpoint-a" is not - * * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have - * `owner` in metadata key but value is not `sd` AND have key/value - * `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - * doesn't have a field called "doesnotexist". Since the filter does not - * match any endpoints, it returns no results - * * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ - * IP` returns endpoints with the corresponding kubernetes_resource_type - * - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * @type string $orderBy - * Optional. The order to list results by. - * - * General `order_by` string syntax: ` () (,)` - * - * * `` allows values: `name`, `address`, `port` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listEndpoints($parent, array $optionalArgs = []) - { - $request = new ListEndpointsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListEndpoints', $optionalArgs, ListEndpointsResponse::class, $request); - } - - /** - * Lists all namespaces. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedParent = $registrationServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $registrationServiceClient->listNamespaces($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $registrationServiceClient->listNamespaces($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the project and location whose namespaces - * you'd like to list. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to list results by. - * - * General `filter` string syntax: - * ` ()` - * - * * `` can be `name`, `labels.` for map field, or - * `attributes.` for attributes field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * - * Examples of valid filters: - * - * * `labels.owner` returns namespaces that have a label with the key - * `owner`, this is the same as `labels:owner` - * * `labels.owner=sd` returns namespaces that have key/value `owner=sd` - * * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` - * returns namespaces that have name that is alphabetically later than the - * string, so "namespace-e" is returned but "namespace-a" is not - * * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have - * `owner` in label key but value is not `sd` AND have key/value `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that namespace - * doesn't have a field called "doesnotexist". Since the filter does not - * match any namespaces, it returns no results - * * `attributes.managed_registration=true` returns namespaces that are - * managed by a GCP product or service - * - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * @type string $orderBy - * Optional. The order to list results by. - * - * General `order_by` string syntax: ` () (,)` - * - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listNamespaces($parent, array $optionalArgs = []) - { - $request = new ListNamespacesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListNamespaces', $optionalArgs, ListNamespacesResponse::class, $request); - } - - /** - * Lists all services belonging to a namespace. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $formattedParent = $registrationServiceClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - * // Iterate over pages of elements - * $pagedResponse = $registrationServiceClient->listServices($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $registrationServiceClient->listServices($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the namespace whose services you'd - * like to list. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. The filter to list results by. - * - * General `filter` string syntax: - * ` ()` - * - * * `` can be `name` or `metadata.` for map field - * * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - * means `HAS`, and is roughly the same as `=` - * * `` must be the same data type as field - * * `` can be `AND`, `OR`, `NOT` - * - * Examples of valid filters: - * - * * `metadata.owner` returns services that have a metadata with the key - * `owner`, this is the same as `metadata:owner` - * * `metadata.protocol=gRPC` returns services that have key/value - * `protocol=gRPC` - * * - * `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` - * returns services that have name that is alphabetically later than the - * string, so "service-e" is returned but "service-a" is not - * * `metadata.owner!=sd AND metadata.foo=bar` returns services that have - * `owner` in metadata key but value is not `sd` AND have key/value - * `foo=bar` - * * `doesnotexist.foo=bar` returns an empty list. Note that service - * doesn't have a field called "doesnotexist". Since the filter does not - * match any services, it returns no results - * * `attributes.managed_registration=true` returns services that are - * managed - * by a GCP product or service - * - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * @type string $orderBy - * Optional. The order to list results by. - * - * General `order_by` string syntax: ` () (,)` - * - * * `` allows value: `name` - * * `` ascending or descending order by ``. If this is - * left blank, `asc` is used - * - * Note that an empty `order_by` string results in default order, which is - * order by `name` in ascending order. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listServices($parent, array $optionalArgs = []) - { - $request = new ListServicesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListServices', $optionalArgs, ListServicesResponse::class, $request); - } - - /** - * Sets the IAM Policy for a resource - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $registrationServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Tests IAM permissions for a resource (namespace, service or - * service workload only). - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $registrationServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param string $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[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates an endpoint. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $endpoint = new Endpoint(); - * $updateMask = new FieldMask(); - * $response = $registrationServiceClient->updateEndpoint($endpoint, $updateMask); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param Endpoint $endpoint Required. The updated endpoint. - * @param FieldMask $updateMask Required. List of fields to be updated in this request. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1beta1\Endpoint - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateEndpoint($endpoint, $updateMask, array $optionalArgs = []) - { - $request = new UpdateEndpointRequest(); - $requestParamHeaders = []; - $request->setEndpoint($endpoint); - $request->setUpdateMask($updateMask); - $requestParamHeaders['endpoint.name'] = $endpoint->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateEndpoint', Endpoint::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a namespace. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $namespace = new PBNamespace(); - * $updateMask = new FieldMask(); - * $response = $registrationServiceClient->updateNamespace($namespace, $updateMask); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param PBNamespace $namespace Required. The updated namespace. - * @param FieldMask $updateMask Required. List of fields to be updated in this request. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1beta1\PBNamespace - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateNamespace($namespace, $updateMask, array $optionalArgs = []) - { - $request = new UpdateNamespaceRequest(); - $requestParamHeaders = []; - $request->setNamespace($namespace); - $request->setUpdateMask($updateMask); - $requestParamHeaders['namespace.name'] = $namespace->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateNamespace', PBNamespace::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a service. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $service = new Service(); - * $updateMask = new FieldMask(); - * $response = $registrationServiceClient->updateService($service, $updateMask); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param Service $service Required. The updated service. - * @param FieldMask $updateMask Required. List of fields to be updated in this request. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\ServiceDirectory\V1beta1\Service - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateService($service, $updateMask, array $optionalArgs = []) - { - $request = new UpdateServiceRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setUpdateMask($updateMask); - $requestParamHeaders['service.name'] = $service->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateService', Service::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * $response = $registrationServiceClient->getLocation(); - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $registrationServiceClient = new RegistrationServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $registrationServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $registrationServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $registrationServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/LookupServiceClient.php b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/LookupServiceClient.php deleted file mode 100644 index 1b19f60f74e..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/LookupServiceClient.php +++ /dev/null @@ -1,36 +0,0 @@ - [ - 'google.cloud.servicedirectory.v1beta1.LookupService' => [ - 'GetLocation' => [ - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - ], - ], -]; diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/lookup_service_rest_client_config.php b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/lookup_service_rest_client_config.php deleted file mode 100644 index c72aa8fc1ef..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/lookup_service_rest_client_config.php +++ /dev/null @@ -1,45 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.servicedirectory.v1beta1.LookupService' => [ - 'ResolveService' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}:resolve', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_client_config.json b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_client_config.json deleted file mode 100644 index 3b641390ccc..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_client_config.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "interfaces": { - "google.cloud.servicedirectory.v1beta1.RegistrationService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE", - "UNKNOWN" - ] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 15000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 15000, - "total_timeout_millis": 15000 - } - }, - "methods": { - "CreateEndpoint": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "CreateNamespace": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "CreateService": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DeleteEndpoint": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DeleteNamespace": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DeleteService": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetEndpoint": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetNamespace": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetService": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListEndpoints": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListNamespaces": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListServices": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateEndpoint": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateNamespace": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateService": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetLocation": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListLocations": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_descriptor_config.php b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_descriptor_config.php deleted file mode 100644 index 57d31357db0..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_descriptor_config.php +++ /dev/null @@ -1,52 +0,0 @@ - [ - 'google.cloud.servicedirectory.v1beta1.RegistrationService' => [ - 'ListEndpoints' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getEndpoints', - ], - ], - 'ListNamespaces' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getNamespaces', - ], - ], - 'ListServices' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getServices', - ], - ], - 'GetLocation' => [ - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - ], - ], -]; diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_rest_client_config.php b/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_rest_client_config.php deleted file mode 100644 index d9a4440f356..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/src/V1beta1/resources/registration_service_rest_client_config.php +++ /dev/null @@ -1,297 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.servicedirectory.v1beta1.RegistrationService' => [ - 'CreateEndpoint' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints', - 'body' => 'endpoint', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'endpoint_id', - ], - ], - 'CreateNamespace' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*}/namespaces', - 'body' => 'namespace', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'namespace_id', - ], - ], - 'CreateService' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/namespaces/*}/services', - 'body' => 'service', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'service_id', - ], - ], - 'DeleteEndpoint' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteNamespace' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/namespaces/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteService' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetEndpoint' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*}:getIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:getIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:getIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'GetNamespace' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/namespaces/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetService' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListEndpoints' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListNamespaces' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*}/namespaces', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListServices' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/namespaces/*}/services', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'UpdateEndpoint' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta1/{endpoint.name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}', - 'body' => 'endpoint', - 'placeholders' => [ - 'endpoint.name' => [ - 'getters' => [ - 'getEndpoint', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - 'UpdateNamespace' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta1/{namespace.name=projects/*/locations/*/namespaces/*}', - 'body' => 'namespace', - 'placeholders' => [ - 'namespace.name' => [ - 'getters' => [ - 'getNamespace', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - 'UpdateService' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta1/{service.name=projects/*/locations/*/namespaces/*/services/*}', - 'body' => 'service', - 'placeholders' => [ - 'service.name' => [ - 'getters' => [ - 'getService', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/tests/Unit/V1beta1/LookupServiceClientTest.php b/owl-bot-staging/ServiceDirectory/v1beta1/tests/Unit/V1beta1/LookupServiceClientTest.php deleted file mode 100644 index c753ea00a15..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/tests/Unit/V1beta1/LookupServiceClientTest.php +++ /dev/null @@ -1,241 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return LookupServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new LookupServiceClient($options); - } - - /** @test */ - public function resolveServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ResolveServiceResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $response = $gapicClient->resolveService($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.LookupService/ResolveService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resolveServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - try { - $gapicClient->resolveService($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/ServiceDirectory/v1beta1/tests/Unit/V1beta1/RegistrationServiceClientTest.php b/owl-bot-staging/ServiceDirectory/v1beta1/tests/Unit/V1beta1/RegistrationServiceClientTest.php deleted file mode 100644 index e4545fe0970..00000000000 --- a/owl-bot-staging/ServiceDirectory/v1beta1/tests/Unit/V1beta1/RegistrationServiceClientTest.php +++ /dev/null @@ -1,1369 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return RegistrationServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new RegistrationServiceClient($options); - } - - /** @test */ - public function createEndpointTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $address = 'address-1147692044'; - $port = 3446913; - $network = 'network1843485230'; - $uid = 'uid115792'; - $expectedResponse = new Endpoint(); - $expectedResponse->setName($name); - $expectedResponse->setAddress($address); - $expectedResponse->setPort($port); - $expectedResponse->setNetwork($network); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $endpointId = 'endpointId-1135808507'; - $endpoint = new Endpoint(); - $response = $gapicClient->createEndpoint($formattedParent, $endpointId, $endpoint); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/CreateEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getEndpointId(); - $this->assertProtobufEquals($endpointId, $actualValue); - $actualValue = $actualRequestObject->getEndpoint(); - $this->assertProtobufEquals($endpoint, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createEndpointExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $endpointId = 'endpointId-1135808507'; - $endpoint = new Endpoint(); - try { - $gapicClient->createEndpoint($formattedParent, $endpointId, $endpoint); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createNamespaceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $uid = 'uid115792'; - $expectedResponse = new PBNamespace(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $namespaceId = 'namespaceId-1253352833'; - $namespace = new PBNamespace(); - $response = $gapicClient->createNamespace($formattedParent, $namespaceId, $namespace); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/CreateNamespace', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getNamespaceId(); - $this->assertProtobufEquals($namespaceId, $actualValue); - $actualValue = $actualRequestObject->getNamespace(); - $this->assertProtobufEquals($namespace, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createNamespaceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $namespaceId = 'namespaceId-1253352833'; - $namespace = new PBNamespace(); - try { - $gapicClient->createNamespace($formattedParent, $namespaceId, $namespace); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - $response = $gapicClient->createService($formattedParent, $serviceId, $service); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/CreateService', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getServiceId(); - $this->assertProtobufEquals($serviceId, $actualValue); - $actualValue = $actualRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - try { - $gapicClient->createService($formattedParent, $serviceId, $service); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteEndpointTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); - $gapicClient->deleteEndpoint($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/DeleteEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteEndpointExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); - try { - $gapicClient->deleteEndpoint($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteNamespaceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $gapicClient->deleteNamespace($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/DeleteNamespace', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteNamespaceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - try { - $gapicClient->deleteNamespace($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $gapicClient->deleteService($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/DeleteService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - try { - $gapicClient->deleteService($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEndpointTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $address = 'address-1147692044'; - $port = 3446913; - $network = 'network1843485230'; - $uid = 'uid115792'; - $expectedResponse = new Endpoint(); - $expectedResponse->setName($name2); - $expectedResponse->setAddress($address); - $expectedResponse->setPort($port); - $expectedResponse->setNetwork($network); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); - $response = $gapicClient->getEndpoint($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/GetEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEndpointExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->endpointName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]', '[ENDPOINT]'); - try { - $gapicClient->getEndpoint($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getNamespaceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $expectedResponse = new PBNamespace(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $response = $gapicClient->getNamespace($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/GetNamespace', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getNamespaceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - try { - $gapicClient->getNamespace($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $response = $gapicClient->getService($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/GetService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - try { - $gapicClient->getService($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEndpointsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $endpointsElement = new Endpoint(); - $endpoints = [ - $endpointsElement, - ]; - $expectedResponse = new ListEndpointsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEndpoints($endpoints); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - $response = $gapicClient->listEndpoints($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEndpoints()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/ListEndpoints', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEndpointsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]', '[SERVICE]'); - try { - $gapicClient->listEndpoints($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listNamespacesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $namespacesElement = new PBNamespace(); - $namespaces = [ - $namespacesElement, - ]; - $expectedResponse = new ListNamespacesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setNamespaces($namespaces); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listNamespaces($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getNamespaces()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/ListNamespaces', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listNamespacesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listNamespaces($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listServicesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $servicesElement = new Service(); - $services = [ - $servicesElement, - ]; - $expectedResponse = new ListServicesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setServices($services); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - $response = $gapicClient->listServices($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/ListServices', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listServicesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[NAMESPACE]'); - try { - $gapicClient->listServices($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateEndpointTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $address = 'address-1147692044'; - $port = 3446913; - $network = 'network1843485230'; - $uid = 'uid115792'; - $expectedResponse = new Endpoint(); - $expectedResponse->setName($name); - $expectedResponse->setAddress($address); - $expectedResponse->setPort($port); - $expectedResponse->setNetwork($network); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $endpoint = new Endpoint(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateEndpoint($endpoint, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/UpdateEndpoint', $actualFuncCall); - $actualValue = $actualRequestObject->getEndpoint(); - $this->assertProtobufEquals($endpoint, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateEndpointExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $endpoint = new Endpoint(); - $updateMask = new FieldMask(); - try { - $gapicClient->updateEndpoint($endpoint, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateNamespaceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $uid = 'uid115792'; - $expectedResponse = new PBNamespace(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $namespace = new PBNamespace(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateNamespace($namespace, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/UpdateNamespace', $actualFuncCall); - $actualValue = $actualRequestObject->getNamespace(); - $this->assertProtobufEquals($namespace, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateNamespaceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $namespace = new PBNamespace(); - $updateMask = new FieldMask(); - try { - $gapicClient->updateNamespace($namespace, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $service = new Service(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateService($service, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.servicedirectory.v1beta1.RegistrationService/UpdateService', $actualFuncCall); - $actualValue = $actualRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateServiceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $service = new Service(); - $updateMask = new FieldMask(); - try { - $gapicClient->updateService($service, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -}