From dc194c14d27fbd2f4070f4b3508d544b2799ff67 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 4 May 2023 04:58:22 +0000 Subject: [PATCH 1/2] docs: Update formatting for `Purpose` class documentation docs: Add documentation for additional acceptable formats for `namespaced_tag_key` and `namespaced_tag_value`in `EffectiveTag`, `parent` in `ListTagKeysRequest`, `parent` in `TagKey`, and `namespaced_name` in `TagValue` PiperOrigin-RevId: 529262150 Source-Link: https://github.com/googleapis/googleapis/commit/e6c8485d04a800238b6c6c3a57dd3fe51b03ac77 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e3b832fc91e0fb8308b13fd723fe82cdc826eb43 Copy-Tag: eyJwIjoiUmVzb3VyY2VNYW5hZ2VyLy5Pd2xCb3QueWFtbCIsImgiOiJlM2I4MzJmYzkxZTBmYjgzMDhiMTNmZDcyM2ZlODJjZGM4MjZlYjQzIn0= --- .../Cloud/Resourcemanager/V3/Folders.php | Bin 0 -> 5416 bytes .../Resourcemanager/V3/Organizations.php | Bin 0 -> 3389 bytes .../Cloud/Resourcemanager/V3/Projects.php | Bin 0 -> 5620 bytes .../Cloud/Resourcemanager/V3/TagBindings.php | 81 ++ .../Cloud/Resourcemanager/V3/TagHolds.php | 66 + .../Cloud/Resourcemanager/V3/TagKeys.php | Bin 0 -> 4764 bytes .../Cloud/Resourcemanager/V3/TagValues.php | 90 ++ .../V3/CreateFolderMetadata.php | 105 ++ .../V3/CreateFolderRequest.php | 81 ++ .../V3/CreateProjectMetadata.php | 155 +++ .../V3/CreateProjectRequest.php | 103 ++ .../V3/CreateTagBindingMetadata.php | 33 + .../V3/CreateTagBindingRequest.php | 115 ++ .../V3/CreateTagHoldMetadata.php | 35 + .../V3/CreateTagHoldRequest.php | 153 +++ .../V3/CreateTagKeyMetadata.php | 33 + .../V3/CreateTagKeyRequest.php | 119 ++ .../V3/CreateTagValueMetadata.php | 33 + .../V3/CreateTagValueRequest.php | 119 ++ .../V3/DeleteFolderMetadata.php | 34 + .../V3/DeleteFolderRequest.php | 71 + .../V3/DeleteOrganizationMetadata.php | 34 + .../V3/DeleteProjectMetadata.php | 34 + .../V3/DeleteProjectRequest.php | 68 + .../V3/DeleteTagBindingMetadata.php | 33 + .../V3/DeleteTagBindingRequest.php | 75 ++ .../V3/DeleteTagHoldMetadata.php | 35 + .../V3/DeleteTagHoldRequest.php | 109 ++ .../V3/DeleteTagKeyMetadata.php | 33 + .../V3/DeleteTagKeyRequest.php | 151 +++ .../V3/DeleteTagValueMetadata.php | 33 + .../V3/DeleteTagValueRequest.php | 147 +++ .../Cloud/ResourceManager/V3/EffectiveTag.php | 289 +++++ .../Cloud/ResourceManager/V3/Folder.php | 392 ++++++ .../Cloud/ResourceManager/V3/Folder/State.php | 64 + .../Cloud/ResourceManager/V3/Folder_State.php | 16 + .../ResourceManager/V3/FoldersGrpcClient.php | 307 +++++ .../ResourceManager/V3/GetFolderRequest.php | 71 + .../V3/GetNamespacedTagKeyRequest.php | 79 ++ .../V3/GetNamespacedTagValueRequest.php | 91 ++ .../V3/GetOrganizationRequest.php | 76 ++ .../ResourceManager/V3/GetProjectRequest.php | 69 + .../ResourceManager/V3/GetTagKeyRequest.php | 71 + .../ResourceManager/V3/GetTagValueRequest.php | 71 + .../V3/ListEffectiveTagsRequest.php | 155 +++ .../V3/ListEffectiveTagsResponse.php | 129 ++ .../ResourceManager/V3/ListFoldersRequest.php | 213 +++ .../V3/ListFoldersResponse.php | 109 ++ .../V3/ListProjectsRequest.php | 207 +++ .../V3/ListProjectsResponse.php | 136 ++ .../V3/ListTagBindingsRequest.php | 155 +++ .../V3/ListTagBindingsResponse.php | 129 ++ .../V3/ListTagHoldsRequest.php | 221 ++++ .../V3/ListTagHoldsResponse.php | 129 ++ .../ResourceManager/V3/ListTagKeysRequest.php | 155 +++ .../V3/ListTagKeysResponse.php | 105 ++ .../V3/ListTagValuesRequest.php | 149 +++ .../V3/ListTagValuesResponse.php | 113 ++ .../ResourceManager/V3/MoveFolderMetadata.php | 135 ++ .../ResourceManager/V3/MoveFolderRequest.php | 113 ++ .../V3/MoveProjectMetadata.php | 34 + .../ResourceManager/V3/MoveProjectRequest.php | 103 ++ .../Cloud/ResourceManager/V3/Organization.php | 372 ++++++ .../ResourceManager/V3/Organization/State.php | 64 + .../ResourceManager/V3/Organization_State.php | 16 + .../V3/OrganizationsGrpcClient.php | 130 ++ .../Cloud/ResourceManager/V3/Project.php | 489 +++++++ .../ResourceManager/V3/Project/State.php | 70 + .../ResourceManager/V3/Project_State.php | 16 + .../ResourceManager/V3/ProjectsGrpcClient.php | 325 +++++ .../Cloud/ResourceManager/V3/Purpose.php | 66 + .../V3/SearchFoldersRequest.php | 247 ++++ .../V3/SearchFoldersResponse.php | 109 ++ .../V3/SearchOrganizationsRequest.php | 203 +++ .../V3/SearchOrganizationsResponse.php | 121 ++ .../V3/SearchProjectsRequest.php | 257 ++++ .../V3/SearchProjectsResponse.php | 138 ++ .../Cloud/ResourceManager/V3/TagBinding.php | 207 +++ .../V3/TagBindingsGrpcClient.php | 101 ++ .../Cloud/ResourceManager/V3/TagHold.php | 256 ++++ .../ResourceManager/V3/TagHoldsGrpcClient.php | 85 ++ .../Cloud/ResourceManager/V3/TagKey.php | 477 +++++++ .../ResourceManager/V3/TagKeysGrpcClient.php | 190 +++ .../Cloud/ResourceManager/V3/TagValue.php | 374 ++++++ .../V3/TagValuesGrpcClient.php | 190 +++ .../V3/UndeleteFolderMetadata.php | 34 + .../V3/UndeleteFolderRequest.php | 71 + .../V3/UndeleteOrganizationMetadata.php | 34 + .../V3/UndeleteProjectMetadata.php | 34 + .../V3/UndeleteProjectRequest.php | 73 ++ .../V3/UpdateFolderMetadata.php | 34 + .../V3/UpdateFolderRequest.php | 135 ++ .../V3/UpdateProjectMetadata.php | 34 + .../V3/UpdateProjectRequest.php | 126 ++ .../V3/UpdateTagKeyMetadata.php | 33 + .../V3/UpdateTagKeyRequest.php | 179 +++ .../V3/UpdateTagValueMetadata.php | 33 + .../V3/UpdateTagValueRequest.php | 171 +++ .../V3/FoldersClient/create_folder.php | 109 ++ .../V3/FoldersClient/delete_folder.php | 89 ++ .../samples/V3/FoldersClient/get_folder.php | 71 + .../V3/FoldersClient/get_iam_policy.php | 70 + .../samples/V3/FoldersClient/list_folders.php | 84 ++ .../samples/V3/FoldersClient/move_folder.php | 99 ++ .../V3/FoldersClient/search_folders.php | 63 + .../V3/FoldersClient/set_iam_policy.php | 73 ++ .../V3/FoldersClient/test_iam_permissions.php | 78 ++ .../V3/FoldersClient/undelete_folder.php | 89 ++ .../V3/FoldersClient/update_folder.php | 101 ++ .../V3/OrganizationsClient/get_iam_policy.php | 71 + .../OrganizationsClient/get_organization.php | 68 + .../search_organizations.php | 64 + .../V3/OrganizationsClient/set_iam_policy.php | 74 ++ .../test_iam_permissions.php | 78 ++ .../V3/ProjectsClient/create_project.php | 72 ++ .../V3/ProjectsClient/delete_project.php | 110 ++ .../V3/ProjectsClient/get_iam_policy.php | 68 + .../samples/V3/ProjectsClient/get_project.php | 70 + .../V3/ProjectsClient/list_projects.php | 80 ++ .../V3/ProjectsClient/move_project.php | 95 ++ .../V3/ProjectsClient/search_projects.php | 67 + .../V3/ProjectsClient/set_iam_policy.php | 109 ++ .../ProjectsClient/test_iam_permissions.php | 75 ++ .../V3/ProjectsClient/undelete_project.php | 88 ++ .../V3/ProjectsClient/update_project.php | 73 ++ .../TagBindingsClient/create_tag_binding.php | 68 + .../TagBindingsClient/delete_tag_binding.php | 77 ++ .../TagBindingsClient/list_effective_tags.php | 73 ++ .../TagBindingsClient/list_tag_bindings.php | 76 ++ .../V3/TagHoldsClient/create_tag_hold.php | 88 ++ .../V3/TagHoldsClient/delete_tag_hold.php | 76 ++ .../V3/TagHoldsClient/list_tag_holds.php | 72 ++ .../V3/TagKeysClient/create_tag_key.php | 89 ++ .../V3/TagKeysClient/delete_tag_key.php | 81 ++ .../V3/TagKeysClient/get_iam_policy.php | 71 + .../TagKeysClient/get_namespaced_tag_key.php | 71 + .../samples/V3/TagKeysClient/get_tag_key.php | 68 + .../V3/TagKeysClient/list_tag_keys.php | 72 ++ .../V3/TagKeysClient/set_iam_policy.php | 73 ++ .../V3/TagKeysClient/test_iam_permissions.php | 78 ++ .../V3/TagKeysClient/update_tag_key.php | 86 ++ .../V3/TagValuesClient/create_tag_value.php | 89 ++ .../V3/TagValuesClient/delete_tag_value.php | 80 ++ .../V3/TagValuesClient/get_iam_policy.php | 71 + .../get_namespaced_tag_value.php | 76 ++ .../V3/TagValuesClient/get_tag_value.php | 68 + .../V3/TagValuesClient/list_tag_values.php | 70 + .../V3/TagValuesClient/set_iam_policy.php | 73 ++ .../TagValuesClient/test_iam_permissions.php | 78 ++ .../V3/TagValuesClient/update_tag_value.php | 86 ++ .../v3/src/V3/FoldersClient.php | 34 + .../v3/src/V3/Gapic/FoldersGapicClient.php | 1119 ++++++++++++++++ .../src/V3/Gapic/OrganizationsGapicClient.php | 544 ++++++++ .../v3/src/V3/Gapic/ProjectsGapicClient.php | 1139 +++++++++++++++++ .../src/V3/Gapic/TagBindingsGapicClient.php | 574 +++++++++ .../v3/src/V3/Gapic/TagHoldsGapicClient.php | 569 ++++++++ .../v3/src/V3/Gapic/TagKeysGapicClient.php | 856 +++++++++++++ .../v3/src/V3/Gapic/TagValuesGapicClient.php | 856 +++++++++++++ .../v3/src/V3/OrganizationsClient.php | 34 + .../v3/src/V3/ProjectsClient.php | 34 + .../v3/src/V3/TagBindingsClient.php | 34 + .../v3/src/V3/TagHoldsClient.php | 34 + .../v3/src/V3/TagKeysClient.php | 34 + .../v3/src/V3/TagValuesClient.php | 34 + .../v3/src/V3/gapic_metadata.json | 332 +++++ .../V3/resources/folders_client_config.json | 99 ++ .../resources/folders_descriptor_config.php | 78 ++ .../resources/folders_rest_client_config.php | 136 ++ .../organizations_client_config.json | 69 + .../organizations_descriptor_config.php | 18 + .../organizations_rest_client_config.php | 73 ++ .../V3/resources/projects_client_config.json | 99 ++ .../resources/projects_descriptor_config.php | 78 ++ .../resources/projects_rest_client_config.php | 133 ++ .../resources/tag_bindings_client_config.json | 64 + .../tag_bindings_descriptor_config.php | 48 + .../tag_bindings_rest_client_config.php | 52 + .../V3/resources/tag_holds_client_config.json | 37 + .../resources/tag_holds_descriptor_config.php | 38 + .../tag_holds_rest_client_config.php | 56 + .../V3/resources/tag_keys_client_config.json | 89 ++ .../resources/tag_keys_descriptor_config.php | 48 + .../resources/tag_keys_rest_client_config.php | 112 ++ .../resources/tag_values_client_config.json | 89 ++ .../tag_values_descriptor_config.php | 48 + .../tag_values_rest_client_config.php | 112 ++ .../v3/tests/Unit/V3/FoldersClientTest.php | 1097 ++++++++++++++++ .../tests/Unit/V3/OrganizationsClientTest.php | 382 ++++++ .../v3/tests/Unit/V3/ProjectsClientTest.php | 1096 ++++++++++++++++ .../tests/Unit/V3/TagBindingsClientTest.php | 447 +++++++ .../v3/tests/Unit/V3/TagHoldsClientTest.php | 385 ++++++ .../v3/tests/Unit/V3/TagKeysClientTest.php | 861 +++++++++++++ .../v3/tests/Unit/V3/TagValuesClientTest.php | 861 +++++++++++++ 193 files changed, 28788 insertions(+) create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Folders.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Organizations.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Projects.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagBindings.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagHolds.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagKeys.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagValues.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteOrganizationMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/EffectiveTag.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder/State.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder_State.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/FoldersGrpcClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetFolderRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagKeyRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagValueRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetOrganizationRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetProjectRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagKeyRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagValueRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization/State.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization_State.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/OrganizationsGrpcClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project/State.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project_State.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ProjectsGrpcClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Purpose.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsResponse.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBinding.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBindingsGrpcClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHold.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHoldsGrpcClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKey.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKeysGrpcClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValue.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValuesGrpcClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteOrganizationMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueMetadata.php create mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueRequest.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/create_folder.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/delete_folder.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_folder.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/list_folders.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/move_folder.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/search_folders.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/set_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/test_iam_permissions.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/undelete_folder.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/update_folder.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_organization.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/search_organizations.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/set_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/test_iam_permissions.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/create_project.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/delete_project.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_project.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/list_projects.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/move_project.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/search_projects.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/set_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/test_iam_permissions.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/undelete_project.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/update_project.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/create_tag_binding.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/delete_tag_binding.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_effective_tags.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_tag_bindings.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/create_tag_hold.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/delete_tag_hold.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/list_tag_holds.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/create_tag_key.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/delete_tag_key.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_namespaced_tag_key.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_tag_key.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/list_tag_keys.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/set_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/test_iam_permissions.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/update_tag_key.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/create_tag_value.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/delete_tag_value.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_namespaced_tag_value.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_tag_value.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/list_tag_values.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/set_iam_policy.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/test_iam_permissions.php create mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/update_tag_value.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/FoldersClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Gapic/FoldersGapicClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Gapic/OrganizationsGapicClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Gapic/ProjectsGapicClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagBindingsGapicClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagHoldsGapicClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagKeysGapicClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagValuesGapicClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/OrganizationsClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/ProjectsClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/TagBindingsClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/TagHoldsClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/TagKeysClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/TagValuesClient.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/gapic_metadata.json create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_client_config.json create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_descriptor_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_rest_client_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_client_config.json create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_descriptor_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_rest_client_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_client_config.json create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_descriptor_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_rest_client_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_client_config.json create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_descriptor_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_rest_client_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_client_config.json create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_descriptor_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_rest_client_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_client_config.json create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_descriptor_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_rest_client_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_client_config.json create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_descriptor_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_rest_client_config.php create mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/FoldersClientTest.php create mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/OrganizationsClientTest.php create mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/ProjectsClientTest.php create mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagBindingsClientTest.php create mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagHoldsClientTest.php create mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagKeysClientTest.php create mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagValuesClientTest.php diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Folders.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Folders.php new file mode 100644 index 0000000000000000000000000000000000000000..de99506633a78f7f9412b3aed0f78cead696ed92 GIT binary patch literal 5416 zcmcIoOK%%h6lR<~O za!rD!yJk+eZHGj`v3*Ue`&2j4N^!|DksWlVvuq-(xQHsop6PgiaR~uGln6v7n1J%E3-mA+f>*#f!e*nAEKT$-c0Jd-;2`L64G%|SG$9@) z;1K99n!alp2YD*rMV6orx(O+u(R29krP*nfInXlXD%(}vB1&wx`=GDjA^bN_P>yzE zLw&PJVMw^3hQ$()<$M&b$K2tHbusar(1*?@_YPkzalW+v|y7;Kf`}oYFMbk~PB*Ciy(C2~k1lgmsWZ1$O z==Uqmex7BcNXzE}T~aDwFt)kx;`0E(x4?NG09>kFxI}VyMUAxTZ(eK|#bq0P8ssBT zXkjZKfuSvAc!dfJVCZSg9pY?Lcf#h7AOzhw_TE9nMdf2Ke9HL$=*bosT%t`BFNFu7 zhXsu$rGuD}R3wxKU?^%;yy!G=0j&pkDXb3`-LE7txJ`Ss6)2+DDJY2ff_FY)JnmQ{ zUxWu2b7ce!MX?B1l+VGHHD?dS5&q{6f_DHc;$Adudhp`Pi_mGkZ5f{bSK(s%KKn2P3i6>yQko2Mhy$($_HS0+h#revbP)sBXQGW)7jrIgY#@R zAAT)?-jERC%$W=k%5suRw#_Qa_!qzZ@m*pB4w3obkerDNCC<>3M<+TxRpIv%=!>u! zoI4XyL|S0F- zp5{|FKG7MQ!lx4Gj}j0(I}%ZG0r9$k7Z}B3Mf6%8 zvvuJ%op?;0xS@8XuOM8(^5B2Aqb znf$l@j|DrrM;Pp%C2%RuYw+xjiYv5K7 zuDsSVa6tnSih8Jyx{fjVt#qu9w=tLes+TK4;QCrBwZFg5;f6ztQ41>UI&B)yj6uoq zs#BebNn539V@hnw#8gBP6WPE^& zQ1BVd-JNfE@-%UCh2HR~OXP-6-Q+iXYwVg(-I+TU5;=Ye7~TSMnH;_be34L?8BL>h rH0_ijP1~8^5s7_OYSX}2j&m!@@1rd^cG)G3M7#0)S>11Pa$JVP22J3cU;F|xe2HOP{X z)(LLN1+E;J;V*FFCve~g^a!_{dZ3qH87`dIU42CU$RzIIi*3DM&pz+RzIytJ({aEe zDqst{8o^D}=p)j>$Z>6A>$Zs+y;cjmNVmI=VPaQ8D7S~6?Nv}dSFF5CO+CBk>R3T- z+isg!)=j(DlwIsU?rN6S#;$yrm2J1JS;ljX7`Ej}+&=)8*2SKq=@=DCTf3NOO^s-^ z0(Vv0X0B@cgRW}T>;?e3sd*mSi@OBJ0MU=rYnX4}NV!I`( zswiztB3jv#%yJNxxieZQ<6~5m5s;gRxIG+?j*yE<&$TuHbe0i&))~!|7YV@mQ(`5H2ww%-~ zN_NGd^-8p^Gd?6QlGTrmpd{30Gpc|c+C7;lXDow{z&{XV-=J;aL*Gc^y(SIynsk^= z-wV8IjzJreWz%oCbYLknL5roV-UxCQDBO=(hK>W#gFs|xUHNcLreAf3(;vvwgYp4c z7?-y_?HZYcMEb_!57S^a-p=qgm}bKvB_JVleQWBaItA~8*{0z+rq-`>QQ}Or1m>HD zi*?$3{kq=sh~33*-Dsw!LY?GiS6~4oSo%?g|9ps=8e%R`YWLyaVQP`OouIXFvbNLB3p}8VRNP zS}lVoyz0W*2nKv`bXr!PM6U`tP8?jY<8xX*j{iN`7lf@DkhG8J1tfk2?iMhK8}H+9 zdbH!<&OkYQ^ioaytFBLuMbtpLj5Sy9#DjQYl)K=%L+`7)M=uLrc}bQz0p0_EKPUFr z*h)opCqM|26rbBat206T4!koqgy+ynjA0Jkj1%C|I8(HGR>SH!uc-%$ks`Wf;crQO z7?!vI(m7r(@dJi8tM~vc99VuijgzmxngKWC0uTNofLlX3fgfIob;u&%H$B-Q#pUn+ z{Ojk$0!*|0;h6RO<^Xl_KLmK?$b9j_7g2;IQle9jch-P z$4l^3^@|7oD1ceYSahF3F$_$HtaP|0#f2fb`5_(uP7_rg^@;c%=PYc~5#HE#62()5 z$EWJGP?y6g$HXIW;==z4ju(qJ1m|}FzzUrK3@&!NhUc-B24;rNKdKT!TfT&5kh3yp z?*nn|0`|xV9uE3W$l;1}hBWeoW{n;lV1}L3w+_1w%Nij?FS40uK(^JRkJTbjau+d5WN%xIyL%M@H!#-ZWM+4 qQIsJ^ic-xsuJX${`zYGPR{UK%wwkjQ!O+L7aBl34?R@su|4(B6Net!8>dL^DTn?6J#}VwX1(i=*j7_6Mmz7l`Ms~- z%)I;W*!wn^7FUsp9L+-&v2-kY`$)7M%d^UsA(rZUd&m*XR?XH8nsOBSoxQR@FeMvSHOLDF^wVYnrK5k&`-1r?AD3QQ324Y8n7jt0C9c%1B(@ zTwX_>R?$4Iuu82IR*03tR@6#iH+>I)vZ1-IxXG-6$3Vn?cD-ciWzqFC5C7cM-J)*l zo~{}CXV|ADaZfW`gq2%m_v&WZ(=AgZ3L9n_&D<7!n?&}eZQ&R!i5wT+*0XR(3OUn5 zj;R@i406kkZhMxqiA5Eqio770xg>f{9ffxnMF)9x$Gk^z z69Xr~e}y(tQ*FJVnx;jfV41F>G<<59=%lz}=*aZ?(|M>Pqq2bV7eng()zjS6r0@-l5~xv8<`!*p_z8PseYcRwj2 zzr~YGGes8mNTn1@tW=o5R7jH>W=q%ElCITKhYKnEQ?zN;*?Ka%9$A}aYepk~DJ#ey zGr;-EW*yBC)^L`X1cx6;csv!pfb{1%a31H0uo}Dq&JjXO2%<1EvOMri9f0Ft$krSj zjzo-q6yPKP*d9?S>XpO*Ul@eTV305aN}R*rE-lI|O&!B7vz_H_qUG;61uj%{*EY1{ zA_X(Z%?t1@7%e*pOBRV2i6Oi)x|rmfa2MsE+I)jpt8QanW?JWa)~X-_ajoIrv~UFR zAy7?>aL@xV2Zju-gbX(U!~u-=F2~!c7K5OyQMIh;Img5kAvq65L*L*i7&t)3ezxF6 zFnFjLb>!zsiM=gI?}9-ZR~QFZw)1K}TikiHy_sFfJONjd-%(cN7epI8VgV3>yiXNM$x zrq`rne3wo1saK>}LLj9=0mQeF=9KqY7z1x17{mc}SS9$VNsIR5rc?u0o2~z!-t2;j z723*8HSqwPXQ88Y-ACkz-!VxC@rYf1CxfXdcaXYxA$PzrFpRH3o>nsao*E`Ch9Osu zX>|-sUkhMjhZ4)n^?}eFBP>GXv_{)O4Gv_#7$-qIf`)r8eF5OQb%>fk{`cmCuK`%W zeXN`GPJt^nbWSunPKtx^(Eb6e55Po*66{L{CgD&-Ob2^@1g`Fwej~s9U8lfglX1T9 z;uBm~5N0yi{g4Wab69V5btS6h6O43?V!Q+|gkM-^D!X{V?*wouN=@+1t{X)aIKa31 z)?*N-Da1G&4?|R3O2=oaPrvX-0bGob59}V0h&+dRjl&FG{^a2DF1_dHREoq);k^b0I2>IuwDyTMhmy zfYA`$z%-9#$Lm%|x<_X;>dXx(*|w>a8fIHXm_1Vy#J@SQl_XEq>y6B`V@LP{&P#;D zddN#ezDHM9{aTuRAwNXp9@!>{`!52x+(dt{d%HDh^ay%~f}WPHw~v3FQ9R87CAd>n zYQ(z}OT(`)3u3Mf-sVu^wS!-7^5KFUUgS{YO)~!bT)Iyo-jQCX5c%af%)MmD5^P1G z4s$X11S8oFEw>;EFLpta>5jw=ZAFocaU^r1|0sn&3jpTvVNVbvr>46u86&{pAYu_} z72)V^H^r%)BqQ4mig-bq>l{0;1q#I-58-a0Og zCyrM4_WjA=Jbs;edzMq1>rWgH9<<85Wg5rJe+yt5zngeaI+4@zMSg9-zn--ze7Nq5 z`qKgW^r~7dlS+&kANM>M?8#=A?zMdRK6Yc34lCsqGOU!h*syZlA9>2V=~FIIVDrpi zpvhzkc%u0{Ci!L*h1yY+CPRv{n=TDuO82bvtzeup=MM`*vqdsJ(93P+id52{|DAvn G0R9C$nR@jA literal 0 HcmV?d00001 diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagBindings.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagBindings.php new file mode 100644 index 000000000000..471ea270e629 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagBindings.php @@ -0,0 +1,81 @@ +internalAddGeneratedFile( + ' + +2google/cloud/resourcemanager/v3/tag_bindings.protogoogle.cloud.resourcemanager.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto" + +TagBinding +name ( BA +parent (  + tag_value ( ! +tag_value_namespaced_name ( :NAK +.cloudresourcemanager.googleapis.com/TagBindingtagBindings/{tag_binding}" +CreateTagBindingMetadata"| +CreateTagBindingRequestE + tag_binding ( 2+.google.cloud.resourcemanager.v3.TagBindingBA + validate_only (BA" +DeleteTagBindingMetadata"_ +DeleteTagBindingRequestD +name ( B6AA0 +.cloudresourcemanager.googleapis.com/TagBinding"d +ListTagBindingsRequest +parent ( B AA* + page_size (BA + +page_token ( BA"u +ListTagBindingsResponseA + tag_bindings ( 2+.google.cloud.resourcemanager.v3.TagBinding +next_page_token ( "` +ListEffectiveTagsRequest +parent ( BA + page_size (BA + +page_token ( BA"{ +ListEffectiveTagsResponseE +effective_tags ( 2-.google.cloud.resourcemanager.v3.EffectiveTag +next_page_token ( " + EffectiveTagD + tag_value ( B1A. +,cloudresourcemanager.googleapis.com/TagValue +namespaced_tag_value ( @ +tag_key ( B/A, +*cloudresourcemanager.googleapis.com/TagKey +namespaced_tag_key (  +tag_key_parent_name (  + inherited (2 + TagBindings +ListTagBindings7.google.cloud.resourcemanager.v3.ListTagBindingsRequest8.google.cloud.resourcemanager.v3.ListTagBindingsResponse" /v3/tagBindingsAparent +CreateTagBinding8.google.cloud.resourcemanager.v3.CreateTagBindingRequest.google.longrunning.Operation"["/v3/tagBindings: tag_bindingA tag_bindingA& + +TagBindingCreateTagBindingMetadata +DeleteTagBinding8.google.cloud.resourcemanager.v3.DeleteTagBindingRequest.google.longrunning.Operation"\\*/v3/{name=tagBindings/**}AnameA1 +google.protobuf.EmptyDeleteTagBindingMetadata +ListEffectiveTags9.google.cloud.resourcemanager.v3.ListEffectiveTagsRequest:.google.cloud.resourcemanager.v3.ListEffectiveTagsResponse""/v3/effectiveTagsAparentA#cloudresourcemanager.googleapis.comAghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB +#com.google.cloud.resourcemanager.v3BTagBindingsProtoPZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpbGoogle.Cloud.ResourceManager.V3Google\\Cloud\\ResourceManager\\V3"Google::Cloud::ResourceManager::V3bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagHolds.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagHolds.php new file mode 100644 index 000000000000..b277c3a03d51 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagHolds.php @@ -0,0 +1,66 @@ +internalAddGeneratedFile( + ' + +/google/cloud/resourcemanager/v3/tag_holds.protogoogle.cloud.resourcemanager.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/longrunning/operations.protogoogle/protobuf/empty.protogoogle/protobuf/timestamp.proto" +TagHold +name ( BA +holder ( BA +origin ( BA + help_link ( BA4 + create_time ( 2.google.protobuf.TimestampBA:[AX ++cloudresourcemanager.googleapis.com/TagHold)tagValues/{tag_value}/tagHolds/{tag_hold}" +CreateTagHoldRequestC +parent ( B3AA-+cloudresourcemanager.googleapis.com/TagHold? +tag_hold ( 2(.google.cloud.resourcemanager.v3.TagHoldBA + validate_only (BA" +CreateTagHoldMetadata"u +DeleteTagHoldRequestA +name ( B3AA- ++cloudresourcemanager.googleapis.com/TagHold + validate_only (BA" +DeleteTagHoldMetadata" +ListTagHoldsRequestC +parent ( B3AA-+cloudresourcemanager.googleapis.com/TagHold + page_size (BA + +page_token ( BA +filter ( BA"l +ListTagHoldsResponse; + tag_holds ( 2(.google.cloud.resourcemanager.v3.TagHold +next_page_token ( 2 +TagHolds + CreateTagHold5.google.cloud.resourcemanager.v3.CreateTagHoldRequest.google.longrunning.Operation"h-"!/v3/{parent=tagValues/*}/tagHolds:tag_holdAparent,tag_holdA +TagHoldCreateTagHoldMetadata + DeleteTagHold5.google.cloud.resourcemanager.v3.DeleteTagHoldRequest.google.longrunning.Operation"a#*!/v3/{name=tagValues/*/tagHolds/*}AnameA. +google.protobuf.EmptyDeleteTagHoldMetadata + ListTagHolds4.google.cloud.resourcemanager.v3.ListTagHoldsRequest5.google.cloud.resourcemanager.v3.ListTagHoldsResponse"2#!/v3/{parent=tagValues/*}/tagHoldsAparentA#cloudresourcemanager.googleapis.comAghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB +#com.google.cloud.resourcemanager.v3B TagHoldsProtoPZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpbGoogle.Cloud.ResourceManager.V3Google\\Cloud\\ResourceManager\\V3"Google::Cloud::ResourceManager::V3bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagKeys.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagKeys.php new file mode 100644 index 0000000000000000000000000000000000000000..b3516ce5ad3428347ae0450f8e6ac66090fca222 GIT binary patch literal 4764 zcmb_gO-~y~819SU{*$t?DlJU{+c0Zg65Akrnq^y1>m*1Mn@ z2aTvgEWH*4HIL*gUeKuKBO*T69p9;uD8E0Gr%tW>h#bTwH;s_*)JYsV6{0Vf=GO>y zst$GRWp2e@U{>snRx9@Q%q&6`&xvDw%c*?=#?TX_!(Z6g@!X0YQ-{LOO*byPzDr%l zbH9co&FQ<27ZcDuDZAV7E7T2qohhvQ6*7KX7dDyf%`gB8=5z(C#8?4F>=mDq$ag$@ zk;IkA4QUXSK-98ogeF|FFXOl6w#=NntB(temURN;oKB+#N$;-f5uuI9pXIojfy3lK z`xMd&p=%d>KVU2ber#FIGc`?|rMTd^#HXFLaIVhFpKRwIO>E46yt(}JTyt*&MJn%mz;yy<7(@( zg2pTfc?Lwon`lt#mstxoI>cH%S)o0P2DcB)o(# zqV9diYY^cdD|1h?iZ2WEXo7=Q@hBUZ!~&rlo6rjL%J0AgYeV@b@DJ;5hZ~w^e1Y() z8&e?@Z;&q=kiz&{5)dLv`oZu2f*Z66Jc9Z|Xp`j_+7*Y>Er_{_5dThtN5s#HaAAxY zE*fsxAr7J56Z`?{lQ?2HBqPxtYm-HM6~d2vMa!uTdEgpbXlR+p!>F@-+!F88{3Mf| zFlT&@a$xm=ngObUtk-8hM8gX_C0Y&7pSMUm@DkkL0`5iP5lUKd z|8M8NibYmRd3{MmI{-}MPyi?HqF$Ne5WT~tha08!&0_iCgUwQLVP$EhxH$9%9zui5 z3&rx%%0}_i!s_afHvM7{^@;<<_^E~lQi+6T&drvTv<%kV-OiLmt{T_B`Rm1xnTvQp z&c>{a92I2Gz~5=8Kgl{gb?y#{tOC_`;v1tJ$Oyj7fIML>Xbw_@SG9@5qXKVi_-BZP zQ}Pwhwu9`9EYG!%@fOFJ#Um-Q^386kQ2wT&!E_4Z^Iek`SKPg=4waf9%wz&ImIYx( z+H;mFD@O(O-?PFy$$W5XVZeU?+;rx(0XHq)Cfq8AYmZG|=MDznvPNYdb9Cwe!%}3j zA*KUXU0M#42BDG>{{n|eXK5RUNsG66m_@<;#H)g}1#5bb1S?dwL5Sw$DuE5Es<9!JLhMSI>||*ZM}b0Umj;Z0! z?1?YGW^OF=M-_8{J*t=+@=;|?Jk6NfGtZQSE#F;|hZiYh!^_Ldj3LZe7Pn(r#|&B4 h_RLNXzb(y-CHKxr@v4z}1Ud5ogiDHtibHgW(0_DxOLqVO literal 0 HcmV?d00001 diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagValues.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagValues.php new file mode 100644 index 000000000000..f0011723b145 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagValues.php @@ -0,0 +1,90 @@ +internalAddGeneratedFile( + ' + +0google/cloud/resourcemanager/v3/tag_values.protogoogle.cloud.resourcemanager.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.proto#google/longrunning/operations.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto" +TagValue +name ( BA +parent ( BA + +short_name ( BAA +namespaced_name ( BA + description ( BA4 + create_time ( 2.google.protobuf.TimestampBA4 + update_time ( 2.google.protobuf.TimestampBA +etag ( BA:KAH +,cloudresourcemanager.googleapis.com/TagValuetagValues/{tag_value}R"b +ListTagValuesRequest +parent ( B AA* + page_size (BA + +page_token ( BA"o +ListTagValuesResponse= + +tag_values ( 2).google.cloud.resourcemanager.v3.TagValue +next_page_token ( "X +GetTagValueRequestB +name ( B4AA. +,cloudresourcemanager.googleapis.com/TagValue"b +GetNamespacedTagValueRequestB +name ( B4AA. +,cloudresourcemanager.googleapis.com/TagValue"v +CreateTagValueRequestA + tag_value ( 2).google.cloud.resourcemanager.v3.TagValueBA + validate_only (BA" +CreateTagValueMetadata" +UpdateTagValueRequestA + tag_value ( 2).google.cloud.resourcemanager.v3.TagValueBA4 + update_mask ( 2.google.protobuf.FieldMaskBA + validate_only (BA" +UpdateTagValueMetadata" +DeleteTagValueRequestB +name ( B4AA. +,cloudresourcemanager.googleapis.com/TagValue + validate_only (BA +etag ( BA" +DeleteTagValueMetadata2 + TagValues + ListTagValues5.google.cloud.resourcemanager.v3.ListTagValuesRequest6.google.cloud.resourcemanager.v3.ListTagValuesResponse" /v3/tagValuesAparent + GetTagValue3.google.cloud.resourcemanager.v3.GetTagValueRequest).google.cloud.resourcemanager.v3.TagValue"%/v3/{name=tagValues/*}Aname +GetNamespacedTagValue=.google.cloud.resourcemanager.v3.GetNamespacedTagValueRequest).google.cloud.resourcemanager.v3.TagValue"\'/v3/tagValues/namespacedAname +CreateTagValue6.google.cloud.resourcemanager.v3.CreateTagValueRequest.google.longrunning.Operation"Q" /v3/tagValues: tag_valueA tag_valueA" +TagValueCreateTagValueMetadata +UpdateTagValue6.google.cloud.resourcemanager.v3.UpdateTagValueRequest.google.longrunning.Operation"p-2 /v3/{tag_value.name=tagValues/*}: tag_valueAtag_value,update_maskA" +TagValueUpdateTagValueMetadata +DeleteTagValue6.google.cloud.resourcemanager.v3.DeleteTagValueRequest.google.longrunning.Operation"J*/v3/{name=tagValues/*}AnameA" +TagValueDeleteTagValueMetadata + GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy"=,"\'/v3/{resource=tagValues/*}:getIamPolicy:*Aresource + SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy"D,"\'/v3/{resource=tagValues/*}:setIamPolicy:*Aresource,policy +TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"O2"-/v3/{resource=tagValues/*}:testIamPermissions:*Aresource,permissionsA#cloudresourcemanager.googleapis.comAghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB +#com.google.cloud.resourcemanager.v3BTagValuesProtoPZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpbGoogle.Cloud.ResourceManager.V3Google\\Cloud\\ResourceManager\\V3"Google::Cloud::ResourceManager::V3bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderMetadata.php new file mode 100644 index 000000000000..965bede9e76c --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderMetadata.php @@ -0,0 +1,105 @@ +google.cloud.resourcemanager.v3.CreateFolderMetadata + */ +class CreateFolderMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The display name of the folder. + * + * Generated from protobuf field string display_name = 1; + */ + protected $display_name = ''; + /** + * The resource name of the folder or organization we are creating the folder + * under. + * + * Generated from protobuf field string parent = 2; + */ + protected $parent = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * The display name of the folder. + * @type string $parent + * The resource name of the folder or organization we are creating the folder + * under. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * The display name of the folder. + * + * Generated from protobuf field string display_name = 1; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The display name of the folder. + * + * Generated from protobuf field string display_name = 1; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The resource name of the folder or organization we are creating the folder + * under. + * + * Generated from protobuf field string parent = 2; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * The resource name of the folder or organization we are creating the folder + * under. + * + * Generated from protobuf field string parent = 2; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderRequest.php new file mode 100644 index 000000000000..b4c7030c11ae --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderRequest.php @@ -0,0 +1,81 @@ +google.cloud.resourcemanager.v3.CreateFolderRequest + */ +class CreateFolderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The folder being created, only the display name and parent will + * be consulted. All other fields will be ignored. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $folder = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceManager\V3\Folder $folder + * Required. The folder being created, only the display name and parent will + * be consulted. All other fields will be ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Required. The folder being created, only the display name and parent will + * be consulted. All other fields will be ignored. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\Folder|null + */ + public function getFolder() + { + return $this->folder; + } + + public function hasFolder() + { + return isset($this->folder); + } + + public function clearFolder() + { + unset($this->folder); + } + + /** + * Required. The folder being created, only the display name and parent will + * be consulted. All other fields will be ignored. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\Folder $var + * @return $this + */ + public function setFolder($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\Folder::class); + $this->folder = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectMetadata.php new file mode 100644 index 000000000000..64d5f69ff7bd --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectMetadata.php @@ -0,0 +1,155 @@ +google.cloud.resourcemanager.v3.CreateProjectMetadata + */ +class CreateProjectMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Creation time of the project creation workflow. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + */ + protected $create_time = null; + /** + * True if the project can be retrieved using `GetProject`. No other + * operations on the project are guaranteed to work until the project creation + * is complete. + * + * Generated from protobuf field bool gettable = 2; + */ + protected $gettable = false; + /** + * True if the project creation process is complete. + * + * Generated from protobuf field bool ready = 3; + */ + protected $ready = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Creation time of the project creation workflow. + * @type bool $gettable + * True if the project can be retrieved using `GetProject`. No other + * operations on the project are guaranteed to work until the project creation + * is complete. + * @type bool $ready + * True if the project creation process is complete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Creation time of the project creation workflow. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @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); + } + + /** + * Creation time of the project creation workflow. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * True if the project can be retrieved using `GetProject`. No other + * operations on the project are guaranteed to work until the project creation + * is complete. + * + * Generated from protobuf field bool gettable = 2; + * @return bool + */ + public function getGettable() + { + return $this->gettable; + } + + /** + * True if the project can be retrieved using `GetProject`. No other + * operations on the project are guaranteed to work until the project creation + * is complete. + * + * Generated from protobuf field bool gettable = 2; + * @param bool $var + * @return $this + */ + public function setGettable($var) + { + GPBUtil::checkBool($var); + $this->gettable = $var; + + return $this; + } + + /** + * True if the project creation process is complete. + * + * Generated from protobuf field bool ready = 3; + * @return bool + */ + public function getReady() + { + return $this->ready; + } + + /** + * True if the project creation process is complete. + * + * Generated from protobuf field bool ready = 3; + * @param bool $var + * @return $this + */ + public function setReady($var) + { + GPBUtil::checkBool($var); + $this->ready = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectRequest.php new file mode 100644 index 000000000000..a565e7f07cc4 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectRequest.php @@ -0,0 +1,103 @@ +google.cloud.resourcemanager.v3.CreateProjectRequest + */ +class CreateProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Project to create. + * Project ID is required. If the requested ID is unavailable, the request + * fails. + * If the `parent` field is set, the `resourcemanager.projects.create` + * permission is checked on the parent resource. If no parent is set and + * the authorization credentials belong to an Organization, the parent + * will be set to that Organization. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceManager\V3\Project $project + * Required. The Project to create. + * Project ID is required. If the requested ID is unavailable, the request + * fails. + * If the `parent` field is set, the `resourcemanager.projects.create` + * permission is checked on the parent resource. If no parent is set and + * the authorization credentials belong to an Organization, the parent + * will be set to that Organization. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Project to create. + * Project ID is required. If the requested ID is unavailable, the request + * fails. + * If the `parent` field is set, the `resourcemanager.projects.create` + * permission is checked on the parent resource. If no parent is set and + * the authorization credentials belong to an Organization, the parent + * will be set to that Organization. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\Project|null + */ + public function getProject() + { + return $this->project; + } + + public function hasProject() + { + return isset($this->project); + } + + public function clearProject() + { + unset($this->project); + } + + /** + * Required. The Project to create. + * Project ID is required. If the requested ID is unavailable, the request + * fails. + * If the `parent` field is set, the `resourcemanager.projects.create` + * permission is checked on the parent resource. If no parent is set and + * the authorization credentials belong to an Organization, the parent + * will be set to that Organization. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\Project $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\Project::class); + $this->project = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingMetadata.php new file mode 100644 index 000000000000..417b98c428c2 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingMetadata.php @@ -0,0 +1,33 @@ +google.cloud.resourcemanager.v3.CreateTagBindingMetadata + */ +class CreateTagBindingMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingRequest.php new file mode 100644 index 000000000000..2874d41e84c6 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingRequest.php @@ -0,0 +1,115 @@ +google.cloud.resourcemanager.v3.CreateTagBindingRequest + */ +class CreateTagBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The TagBinding to be created. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tag_binding = null; + /** + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceManager\V3\TagBinding $tag_binding + * Required. The TagBinding to be created. + * @type bool $validate_only + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + + /** + * Required. The TagBinding to be created. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\TagBinding|null + */ + public function getTagBinding() + { + return $this->tag_binding; + } + + public function hasTagBinding() + { + return isset($this->tag_binding); + } + + public function clearTagBinding() + { + unset($this->tag_binding); + } + + /** + * Required. The TagBinding to be created. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\TagBinding $var + * @return $this + */ + public function setTagBinding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagBinding::class); + $this->tag_binding = $var; + + return $this; + } + + /** + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldMetadata.php new file mode 100644 index 000000000000..ad0b4f18f9b5 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldMetadata.php @@ -0,0 +1,35 @@ +google.cloud.resourcemanager.v3.CreateTagHoldMetadata + */ +class CreateTagHoldMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldRequest.php new file mode 100644 index 000000000000..cddfa61f81bf --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldRequest.php @@ -0,0 +1,153 @@ +google.cloud.resourcemanager.v3.CreateTagHoldRequest + */ +class CreateTagHoldRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the TagHold's parent TagValue. Must be of + * the form: `tagValues/{tag-value-id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The TagHold to be created. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagHold tag_hold = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tag_hold = null; + /** + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the TagHold's parent TagValue. Must be of + * the form: `tagValues/{tag-value-id}`. + * @type \Google\Cloud\ResourceManager\V3\TagHold $tag_hold + * Required. The TagHold to be created. + * @type bool $validate_only + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the TagHold's parent TagValue. Must be of + * the form: `tagValues/{tag-value-id}`. + * + * 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 TagHold's parent TagValue. Must be of + * the form: `tagValues/{tag-value-id}`. + * + * 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 TagHold to be created. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagHold tag_hold = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\TagHold|null + */ + public function getTagHold() + { + return $this->tag_hold; + } + + public function hasTagHold() + { + return isset($this->tag_hold); + } + + public function clearTagHold() + { + unset($this->tag_hold); + } + + /** + * Required. The TagHold to be created. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagHold tag_hold = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\TagHold $var + * @return $this + */ + public function setTagHold($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagHold::class); + $this->tag_hold = $var; + + return $this; + } + + /** + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyMetadata.php new file mode 100644 index 000000000000..6dcfd2f3e912 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyMetadata.php @@ -0,0 +1,33 @@ +google.cloud.resourcemanager.v3.CreateTagKeyMetadata + */ +class CreateTagKeyMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyRequest.php new file mode 100644 index 000000000000..457aa1452447 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyRequest.php @@ -0,0 +1,119 @@ +google.cloud.resourcemanager.v3.CreateTagKeyRequest + */ +class CreateTagKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The TagKey to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tag_key = null; + /** + * Optional. Set to true to perform validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceManager\V3\TagKey $tag_key + * Required. The TagKey to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * @type bool $validate_only + * Optional. Set to true to perform validations necessary for creating the + * resource, but not actually perform the action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + + /** + * Required. The TagKey to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\TagKey|null + */ + public function getTagKey() + { + return $this->tag_key; + } + + public function hasTagKey() + { + return isset($this->tag_key); + } + + public function clearTagKey() + { + unset($this->tag_key); + } + + /** + * Required. The TagKey to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\TagKey $var + * @return $this + */ + public function setTagKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagKey::class); + $this->tag_key = $var; + + return $this; + } + + /** + * Optional. Set to true to perform validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Set to true to perform validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueMetadata.php new file mode 100644 index 000000000000..4783b3262bab --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueMetadata.php @@ -0,0 +1,33 @@ +google.cloud.resourcemanager.v3.CreateTagValueMetadata + */ +class CreateTagValueMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueRequest.php new file mode 100644 index 000000000000..c04330efa387 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueRequest.php @@ -0,0 +1,119 @@ +google.cloud.resourcemanager.v3.CreateTagValueRequest + */ +class CreateTagValueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The TagValue to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tag_value = null; + /** + * Optional. Set as true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceManager\V3\TagValue $tag_value + * Required. The TagValue to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * @type bool $validate_only + * Optional. Set as true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + + /** + * Required. The TagValue to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\TagValue|null + */ + public function getTagValue() + { + return $this->tag_value; + } + + public function hasTagValue() + { + return isset($this->tag_value); + } + + public function clearTagValue() + { + unset($this->tag_value); + } + + /** + * Required. The TagValue to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\TagValue $var + * @return $this + */ + public function setTagValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagValue::class); + $this->tag_value = $var; + + return $this; + } + + /** + * Optional. Set as true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Set as true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderMetadata.php new file mode 100644 index 000000000000..218142421f95 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.DeleteFolderMetadata + */ +class DeleteFolderMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderRequest.php new file mode 100644 index 000000000000..b22fd65f7eab --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderRequest.php @@ -0,0 +1,71 @@ +google.cloud.resourcemanager.v3.DeleteFolderRequest + */ +class DeleteFolderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the folder to be deleted. + * Must be of the form `folders/{folder_id}`. + * + * 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 resource name of the folder to be deleted. + * Must be of the form `folders/{folder_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the folder to be deleted. + * Must be of the form `folders/{folder_id}`. + * + * 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 resource name of the folder to be deleted. + * Must be of the form `folders/{folder_id}`. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteOrganizationMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteOrganizationMetadata.php new file mode 100644 index 000000000000..e1f9c4856206 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteOrganizationMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.DeleteOrganizationMetadata + */ +class DeleteOrganizationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectMetadata.php new file mode 100644 index 000000000000..ccb5bc729caf --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.DeleteProjectMetadata + */ +class DeleteProjectMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectRequest.php new file mode 100644 index 000000000000..46af54101c2c --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectRequest.php @@ -0,0 +1,68 @@ +google.cloud.resourcemanager.v3.DeleteProjectRequest + */ +class DeleteProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the Project (for example, `projects/415104041262`). + * + * 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 Project (for example, `projects/415104041262`). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the Project (for example, `projects/415104041262`). + * + * 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 Project (for example, `projects/415104041262`). + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingMetadata.php new file mode 100644 index 000000000000..ceaecd1073fa --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingMetadata.php @@ -0,0 +1,33 @@ +google.cloud.resourcemanager.v3.DeleteTagBindingMetadata + */ +class DeleteTagBindingMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingRequest.php new file mode 100644 index 000000000000..6a9bd97cae5b --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingRequest.php @@ -0,0 +1,75 @@ +google.cloud.resourcemanager.v3.DeleteTagBindingRequest + */ +class DeleteTagBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the TagBinding. This is a String of the form: + * `tagBindings/{id}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * + * 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 TagBinding. This is a String of the form: + * `tagBindings/{id}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the TagBinding. This is a String of the form: + * `tagBindings/{id}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * + * 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 TagBinding. This is a String of the form: + * `tagBindings/{id}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldMetadata.php new file mode 100644 index 000000000000..dc16e59f2a7e --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldMetadata.php @@ -0,0 +1,35 @@ +google.cloud.resourcemanager.v3.DeleteTagHoldMetadata + */ +class DeleteTagHoldMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldRequest.php new file mode 100644 index 000000000000..b3a72dc96881 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldRequest.php @@ -0,0 +1,109 @@ +google.cloud.resourcemanager.v3.DeleteTagHoldRequest + */ +class DeleteTagHoldRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the TagHold to delete. Must be of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Set to true to perform the validations necessary for deleting the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the TagHold to delete. Must be of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. + * @type bool $validate_only + * Optional. Set to true to perform the validations necessary for deleting the + * resource, but not actually perform the action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the TagHold to delete. Must be of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. + * + * 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 resource name of the TagHold to delete. Must be of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. + * + * 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. Set to true to perform the validations necessary for deleting the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Set to true to perform the validations necessary for deleting the + * resource, but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyMetadata.php new file mode 100644 index 000000000000..f4c106279114 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyMetadata.php @@ -0,0 +1,33 @@ +google.cloud.resourcemanager.v3.DeleteTagKeyMetadata + */ +class DeleteTagKeyMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyRequest.php new file mode 100644 index 000000000000..101222fd0599 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyRequest.php @@ -0,0 +1,151 @@ +google.cloud.resourcemanager.v3.DeleteTagKeyRequest + */ +class DeleteTagKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of a TagKey to be deleted in the format + * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or + * it will not be deleted successfully. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Set as true to perform validations necessary for deletion, but + * not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. The etag known to the client for the expected state of the + * TagKey. This is to be used for optimistic concurrency. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of a TagKey to be deleted in the format + * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or + * it will not be deleted successfully. + * @type bool $validate_only + * Optional. Set as true to perform validations necessary for deletion, but + * not actually perform the action. + * @type string $etag + * Optional. The etag known to the client for the expected state of the + * TagKey. This is to be used for optimistic concurrency. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of a TagKey to be deleted in the format + * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or + * it will not be deleted successfully. + * + * 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 resource name of a TagKey to be deleted in the format + * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or + * it will not be deleted successfully. + * + * 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. Set as true to perform validations necessary for deletion, but + * not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Set as true to perform validations necessary for deletion, but + * not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. The etag known to the client for the expected state of the + * TagKey. This is to be used for optimistic concurrency. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The etag known to the client for the expected state of the + * TagKey. This is to be used for optimistic concurrency. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueMetadata.php new file mode 100644 index 000000000000..0b447cb8bcd4 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueMetadata.php @@ -0,0 +1,33 @@ +google.cloud.resourcemanager.v3.DeleteTagValueMetadata + */ +class DeleteTagValueMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueRequest.php new file mode 100644 index 000000000000..9440dd2a4d00 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueRequest.php @@ -0,0 +1,147 @@ +google.cloud.resourcemanager.v3.DeleteTagValueRequest + */ +class DeleteTagValueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name for TagValue to be deleted in the format + * tagValues/456. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Set as true to perform the validations necessary for deletion, + * but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. The etag known to the client for the expected state of the + * TagValue. This is to be used for optimistic concurrency. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name for TagValue to be deleted in the format + * tagValues/456. + * @type bool $validate_only + * Optional. Set as true to perform the validations necessary for deletion, + * but not actually perform the action. + * @type string $etag + * Optional. The etag known to the client for the expected state of the + * TagValue. This is to be used for optimistic concurrency. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name for TagValue to be deleted in the format + * tagValues/456. + * + * 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. Resource name for TagValue to be deleted in the format + * tagValues/456. + * + * 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. Set as true to perform the validations necessary for deletion, + * but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Set as true to perform the validations necessary for deletion, + * but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. The etag known to the client for the expected state of the + * TagValue. This is to be used for optimistic concurrency. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The etag known to the client for the expected state of the + * TagValue. This is to be used for optimistic concurrency. + * + * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/EffectiveTag.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/EffectiveTag.php new file mode 100644 index 000000000000..321ccbdb0248 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/EffectiveTag.php @@ -0,0 +1,289 @@ +google.cloud.resourcemanager.v3.EffectiveTag + */ +class EffectiveTag extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name for TagValue in the format `tagValues/456`. + * + * Generated from protobuf field string tag_value = 1 [(.google.api.resource_reference) = { + */ + protected $tag_value = ''; + /** + * The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * + * Generated from protobuf field string namespaced_tag_value = 2; + */ + protected $namespaced_tag_value = ''; + /** + * The name of the TagKey, in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * + * Generated from protobuf field string tag_key = 3 [(.google.api.resource_reference) = { + */ + protected $tag_key = ''; + /** + * The namespaced name of the TagKey. Can be in the form + * `{organization_id}/{tag_key_short_name}` or + * `{project_id}/{tag_key_short_name}` or + * `{project_number}/{tag_key_short_name}`. + * + * Generated from protobuf field string namespaced_tag_key = 4; + */ + protected $namespaced_tag_key = ''; + /** + * The parent name of the tag key. + * Must be in the format `organizations/{organization_id}` or + * `projects/{project_number}` + * + * Generated from protobuf field string tag_key_parent_name = 6; + */ + protected $tag_key_parent_name = ''; + /** + * Indicates the inheritance status of a tag value + * attached to the given resource. If the tag value is inherited from one of + * the resource's ancestors, inherited will be true. If false, then the tag + * value is directly attached to the resource, inherited will be false. + * + * Generated from protobuf field bool inherited = 5; + */ + protected $inherited = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $tag_value + * Resource name for TagValue in the format `tagValues/456`. + * @type string $namespaced_tag_value + * The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * @type string $tag_key + * The name of the TagKey, in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * @type string $namespaced_tag_key + * The namespaced name of the TagKey. Can be in the form + * `{organization_id}/{tag_key_short_name}` or + * `{project_id}/{tag_key_short_name}` or + * `{project_number}/{tag_key_short_name}`. + * @type string $tag_key_parent_name + * The parent name of the tag key. + * Must be in the format `organizations/{organization_id}` or + * `projects/{project_number}` + * @type bool $inherited + * Indicates the inheritance status of a tag value + * attached to the given resource. If the tag value is inherited from one of + * the resource's ancestors, inherited will be true. If false, then the tag + * value is directly attached to the resource, inherited will be false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + + /** + * Resource name for TagValue in the format `tagValues/456`. + * + * Generated from protobuf field string tag_value = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getTagValue() + { + return $this->tag_value; + } + + /** + * Resource name for TagValue in the format `tagValues/456`. + * + * Generated from protobuf field string tag_value = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTagValue($var) + { + GPBUtil::checkString($var, True); + $this->tag_value = $var; + + return $this; + } + + /** + * The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * + * Generated from protobuf field string namespaced_tag_value = 2; + * @return string + */ + public function getNamespacedTagValue() + { + return $this->namespaced_tag_value; + } + + /** + * The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * + * Generated from protobuf field string namespaced_tag_value = 2; + * @param string $var + * @return $this + */ + public function setNamespacedTagValue($var) + { + GPBUtil::checkString($var, True); + $this->namespaced_tag_value = $var; + + return $this; + } + + /** + * The name of the TagKey, in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * + * Generated from protobuf field string tag_key = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getTagKey() + { + return $this->tag_key; + } + + /** + * The name of the TagKey, in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * + * Generated from protobuf field string tag_key = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTagKey($var) + { + GPBUtil::checkString($var, True); + $this->tag_key = $var; + + return $this; + } + + /** + * The namespaced name of the TagKey. Can be in the form + * `{organization_id}/{tag_key_short_name}` or + * `{project_id}/{tag_key_short_name}` or + * `{project_number}/{tag_key_short_name}`. + * + * Generated from protobuf field string namespaced_tag_key = 4; + * @return string + */ + public function getNamespacedTagKey() + { + return $this->namespaced_tag_key; + } + + /** + * The namespaced name of the TagKey. Can be in the form + * `{organization_id}/{tag_key_short_name}` or + * `{project_id}/{tag_key_short_name}` or + * `{project_number}/{tag_key_short_name}`. + * + * Generated from protobuf field string namespaced_tag_key = 4; + * @param string $var + * @return $this + */ + public function setNamespacedTagKey($var) + { + GPBUtil::checkString($var, True); + $this->namespaced_tag_key = $var; + + return $this; + } + + /** + * The parent name of the tag key. + * Must be in the format `organizations/{organization_id}` or + * `projects/{project_number}` + * + * Generated from protobuf field string tag_key_parent_name = 6; + * @return string + */ + public function getTagKeyParentName() + { + return $this->tag_key_parent_name; + } + + /** + * The parent name of the tag key. + * Must be in the format `organizations/{organization_id}` or + * `projects/{project_number}` + * + * Generated from protobuf field string tag_key_parent_name = 6; + * @param string $var + * @return $this + */ + public function setTagKeyParentName($var) + { + GPBUtil::checkString($var, True); + $this->tag_key_parent_name = $var; + + return $this; + } + + /** + * Indicates the inheritance status of a tag value + * attached to the given resource. If the tag value is inherited from one of + * the resource's ancestors, inherited will be true. If false, then the tag + * value is directly attached to the resource, inherited will be false. + * + * Generated from protobuf field bool inherited = 5; + * @return bool + */ + public function getInherited() + { + return $this->inherited; + } + + /** + * Indicates the inheritance status of a tag value + * attached to the given resource. If the tag value is inherited from one of + * the resource's ancestors, inherited will be true. If false, then the tag + * value is directly attached to the resource, inherited will be false. + * + * Generated from protobuf field bool inherited = 5; + * @param bool $var + * @return $this + */ + public function setInherited($var) + { + GPBUtil::checkBool($var); + $this->inherited = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder.php new file mode 100644 index 000000000000..a2a3f4bc7eba --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder.php @@ -0,0 +1,392 @@ +google.cloud.resourcemanager.v3.Folder + */ +class Folder extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the folder. + * Its format is `folders/{folder_id}`, for example: "folders/1234". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. The folder's parent's resource name. + * Updates to the folder's parent must be performed using + * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder]. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * The folder's display name. + * A folder's display name must be unique amongst its siblings. For example, + * no two folders with the same parent can share the same display name. + * The display name must start and end with a letter or digit, may contain + * letters, digits, spaces, hyphens and underscores and can be no longer + * than 30 characters. This is captured by the regular expression: + * `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. + * + * Generated from protobuf field string display_name = 3; + */ + protected $display_name = ''; + /** + * Output only. The lifecycle state of the folder. + * Updates to the state must be performed using + * [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and + * [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder]. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. Timestamp when the folder was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Timestamp when the folder was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Timestamp when the folder was requested to be deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. A checksum computed by the server based on the current value + * of the folder resource. This may be sent on update and delete requests to + * ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the folder. + * Its format is `folders/{folder_id}`, for example: "folders/1234". + * @type string $parent + * Required. The folder's parent's resource name. + * Updates to the folder's parent must be performed using + * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder]. + * @type string $display_name + * The folder's display name. + * A folder's display name must be unique amongst its siblings. For example, + * no two folders with the same parent can share the same display name. + * The display name must start and end with a letter or digit, may contain + * letters, digits, spaces, hyphens and underscores and can be no longer + * than 30 characters. This is captured by the regular expression: + * `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. + * @type int $state + * Output only. The lifecycle state of the folder. + * Updates to the state must be performed using + * [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and + * [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder]. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Timestamp when the folder was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Timestamp when the folder was last modified. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. Timestamp when the folder was requested to be deleted. + * @type string $etag + * Output only. A checksum computed by the server based on the current value + * of the folder resource. This may be sent on update and delete requests to + * ensure the client has an up-to-date value before proceeding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the folder. + * Its format is `folders/{folder_id}`, for example: "folders/1234". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the folder. + * Its format is `folders/{folder_id}`, for example: "folders/1234". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The folder's parent's resource name. + * Updates to the folder's parent must be performed using + * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder]. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The folder's parent's resource name. + * Updates to the folder's parent must be performed using + * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder]. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The folder's display name. + * A folder's display name must be unique amongst its siblings. For example, + * no two folders with the same parent can share the same display name. + * The display name must start and end with a letter or digit, may contain + * letters, digits, spaces, hyphens and underscores and can be no longer + * than 30 characters. This is captured by the regular expression: + * `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. + * + * Generated from protobuf field string display_name = 3; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The folder's display name. + * A folder's display name must be unique amongst its siblings. For example, + * no two folders with the same parent can share the same display name. + * The display name must start and end with a letter or digit, may contain + * letters, digits, spaces, hyphens and underscores and can be no longer + * than 30 characters. This is captured by the regular expression: + * `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. + * + * Generated from protobuf field string display_name = 3; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The lifecycle state of the folder. + * Updates to the state must be performed using + * [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and + * [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder]. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The lifecycle state of the folder. + * Updates to the state must be performed using + * [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and + * [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder]. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V3\Folder\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Timestamp when the folder was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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. Timestamp when the folder was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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. Timestamp when the folder was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.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. Timestamp when the folder was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.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. Timestamp when the folder was requested to be deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. Timestamp when the folder was requested to be deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. A checksum computed by the server based on the current value + * of the folder resource. This may be sent on update and delete requests to + * ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. A checksum computed by the server based on the current value + * of the folder resource. This may be sent on update and delete requests to + * ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder/State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder/State.php new file mode 100644 index 000000000000..1758cdf0f34b --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder/State.php @@ -0,0 +1,64 @@ +google.cloud.resourcemanager.v3.Folder.State + */ +class State +{ + /** + * Unspecified state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The normal and active state. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * The folder has been marked for deletion by the user. + * + * Generated from protobuf enum DELETE_REQUESTED = 2; + */ + const DELETE_REQUESTED = 2; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::DELETE_REQUESTED => 'DELETE_REQUESTED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\ResourceManager\V3\Folder_State::class); + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder_State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder_State.php new file mode 100644 index 000000000000..9f625b05f94d --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder_State.php @@ -0,0 +1,16 @@ +_simpleRequest('/google.cloud.resourcemanager.v3.Folders/GetFolder', + $argument, + ['\Google\Cloud\ResourceManager\V3\Folder', 'decode'], + $metadata, $options); + } + + /** + * Lists the folders that are direct descendants of supplied parent resource. + * `list()` provides a strongly consistent view of the folders underneath + * the specified parent resource. + * `list()` returns folders sorted based upon the (ascending) lexical ordering + * of their display_name. + * The caller must have `resourcemanager.folders.list` permission on the + * identified parent. + * @param \Google\Cloud\ResourceManager\V3\ListFoldersRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListFolders(\Google\Cloud\ResourceManager\V3\ListFoldersRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/ListFolders', + $argument, + ['\Google\Cloud\ResourceManager\V3\ListFoldersResponse', 'decode'], + $metadata, $options); + } + + /** + * Search for folders that match specific filter criteria. + * `search()` provides an eventually consistent view of the folders a user has + * access to which meet the specified filter criteria. + * + * This will only return folders on which the caller has the + * permission `resourcemanager.folders.get`. + * @param \Google\Cloud\ResourceManager\V3\SearchFoldersRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function SearchFolders(\Google\Cloud\ResourceManager\V3\SearchFoldersRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/SearchFolders', + $argument, + ['\Google\Cloud\ResourceManager\V3\SearchFoldersResponse', 'decode'], + $metadata, $options); + } + + /** + * Creates a folder in the resource hierarchy. + * Returns an `Operation` which can be used to track the progress of the + * folder creation workflow. + * Upon success, the `Operation.response` field will be populated with the + * created Folder. + * + * In order to succeed, the addition of this new folder must not violate + * the folder naming, height, or fanout constraints. + * + * + The folder's `display_name` must be distinct from all other folders that + * share its parent. + * + The addition of the folder must not cause the active folder hierarchy + * to exceed a height of 10. Note, the full active + deleted folder hierarchy + * is allowed to reach a height of 20; this provides additional headroom when + * moving folders that contain deleted folders. + * + The addition of the folder must not cause the total number of folders + * under its parent to exceed 300. + * + * If the operation fails due to a folder constraint violation, some errors + * may be returned by the `CreateFolder` request, with status code + * `FAILED_PRECONDITION` and an error description. Other folder constraint + * violations will be communicated in the `Operation`, with the specific + * `PreconditionFailure` returned in the details list in the `Operation.error` + * field. + * + * The caller must have `resourcemanager.folders.create` permission on the + * identified parent. + * @param \Google\Cloud\ResourceManager\V3\CreateFolderRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateFolder(\Google\Cloud\ResourceManager\V3\CreateFolderRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/CreateFolder', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Updates a folder, changing its `display_name`. + * Changes to the folder `display_name` will be rejected if they violate + * either the `display_name` formatting rules or the naming constraints + * described in the + * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] + * documentation. + * + * The folder's `display_name` must start and end with a letter or digit, + * may contain letters, digits, spaces, hyphens and underscores and can be + * between 3 and 30 characters. This is captured by the regular expression: + * `[\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]`. + * The caller must have `resourcemanager.folders.update` permission on the + * identified folder. + * + * If the update fails due to the unique name constraint then a + * `PreconditionFailure` explaining this violation will be returned + * in the Status.details field. + * @param \Google\Cloud\ResourceManager\V3\UpdateFolderRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateFolder(\Google\Cloud\ResourceManager\V3\UpdateFolderRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/UpdateFolder', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Moves a folder under a new resource parent. + * Returns an `Operation` which can be used to track the progress of the + * folder move workflow. + * Upon success, the `Operation.response` field will be populated with the + * moved folder. + * Upon failure, a `FolderOperationError` categorizing the failure cause will + * be returned - if the failure occurs synchronously then the + * `FolderOperationError` will be returned in the `Status.details` field. + * If it occurs asynchronously, then the FolderOperation will be returned + * in the `Operation.error` field. + * In addition, the `Operation.metadata` field will be populated with a + * `FolderOperation` message as an aid to stateless clients. + * Folder moves will be rejected if they violate either the naming, height, + * or fanout constraints described in the + * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] + * documentation. The caller must have `resourcemanager.folders.move` + * permission on the folder's current and proposed new parent. + * @param \Google\Cloud\ResourceManager\V3\MoveFolderRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function MoveFolder(\Google\Cloud\ResourceManager\V3\MoveFolderRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/MoveFolder', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Requests deletion of a folder. The folder is moved into the + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + * state immediately, and is deleted approximately 30 days later. This method + * may only be called on an empty folder, where a folder is empty if it + * doesn't contain any folders or projects in the + * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If + * called on a folder in + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + * state the operation will result in a no-op success. + * The caller must have `resourcemanager.folders.delete` permission on the + * identified folder. + * @param \Google\Cloud\ResourceManager\V3\DeleteFolderRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteFolder(\Google\Cloud\ResourceManager\V3\DeleteFolderRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/DeleteFolder', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Cancels the deletion request for a folder. This method may be called on a + * folder in any state. If the folder is in the + * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the + * result will be a no-op success. In order to succeed, the folder's parent + * must be in the + * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In + * addition, reintroducing the folder into the tree must not violate folder + * naming, height, and fanout constraints described in the + * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] + * documentation. The caller must have `resourcemanager.folders.undelete` + * permission on the identified folder. + * @param \Google\Cloud\ResourceManager\V3\UndeleteFolderRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UndeleteFolder(\Google\Cloud\ResourceManager\V3\UndeleteFolderRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/UndeleteFolder', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Gets the access control policy for a folder. The returned policy may be + * empty if no such policy or resource exists. The `resource` field should + * be the folder's resource name, for example: "folders/1234". + * The caller must have `resourcemanager.folders.getIamPolicy` permission + * on the identified folder. + * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/GetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * Sets the access control policy on a folder, replacing any existing policy. + * The `resource` field should be the folder's resource name, for example: + * "folders/1234". + * The caller must have `resourcemanager.folders.setIamPolicy` permission + * on the identified folder. + * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/SetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * Returns permissions that a caller has on the specified folder. + * The `resource` field should be the folder's resource name, + * for example: "folders/1234". + * + * There are no permissions required for making this API call. + * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/TestIamPermissions', + $argument, + ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetFolderRequest.php new file mode 100644 index 000000000000..9eafd6494505 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetFolderRequest.php @@ -0,0 +1,71 @@ +google.cloud.resourcemanager.v3.GetFolderRequest + */ +class GetFolderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the folder to retrieve. + * Must be of the form `folders/{folder_id}`. + * + * 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 resource name of the folder to retrieve. + * Must be of the form `folders/{folder_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the folder to retrieve. + * Must be of the form `folders/{folder_id}`. + * + * 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 resource name of the folder to retrieve. + * Must be of the form `folders/{folder_id}`. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagKeyRequest.php new file mode 100644 index 000000000000..496f2478f43a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagKeyRequest.php @@ -0,0 +1,79 @@ +google.cloud.resourcemanager.v3.GetNamespacedTagKeyRequest + */ +class GetNamespacedTagKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A namespaced tag key name in the format + * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name + * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short + * name "bar" under the project `r2-d2`. + * + * 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. A namespaced tag key name in the format + * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name + * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short + * name "bar" under the project `r2-d2`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + + /** + * Required. A namespaced tag key name in the format + * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name + * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short + * name "bar" under the project `r2-d2`. + * + * 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. A namespaced tag key name in the format + * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name + * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short + * name "bar" under the project `r2-d2`. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagValueRequest.php new file mode 100644 index 000000000000..945854f15b93 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagValueRequest.php @@ -0,0 +1,91 @@ +google.cloud.resourcemanager.v3.GetNamespacedTagValueRequest + */ +class GetNamespacedTagValueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A namespaced tag value name in the following format: + * `{parentId}/{tagKeyShort}/{tagValueShort}` + * Examples: + * - `42/foo/abc` for a value with short name "abc" under the key with short + * name "foo" under the organization with ID 42 + * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with + * short name "bar" under the project with ID "r2-d2" + * + * 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. A namespaced tag value name in the following format: + * `{parentId}/{tagKeyShort}/{tagValueShort}` + * Examples: + * - `42/foo/abc` for a value with short name "abc" under the key with short + * name "foo" under the organization with ID 42 + * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with + * short name "bar" under the project with ID "r2-d2" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + + /** + * Required. A namespaced tag value name in the following format: + * `{parentId}/{tagKeyShort}/{tagValueShort}` + * Examples: + * - `42/foo/abc` for a value with short name "abc" under the key with short + * name "foo" under the organization with ID 42 + * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with + * short name "bar" under the project with ID "r2-d2" + * + * 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. A namespaced tag value name in the following format: + * `{parentId}/{tagKeyShort}/{tagValueShort}` + * Examples: + * - `42/foo/abc` for a value with short name "abc" under the key with short + * name "foo" under the organization with ID 42 + * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with + * short name "bar" under the project with ID "r2-d2" + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetOrganizationRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetOrganizationRequest.php new file mode 100644 index 000000000000..3cf50c096eb7 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetOrganizationRequest.php @@ -0,0 +1,76 @@ +google.cloud.resourcemanager.v3.GetOrganizationRequest + */ +class GetOrganizationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Organization to fetch. This is the + * organization's relative path in the API, formatted as + * "organizations/[organizationId]". For example, "organizations/1234". + * + * 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 resource name of the Organization to fetch. This is the + * organization's relative path in the API, formatted as + * "organizations/[organizationId]". For example, "organizations/1234". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Organization to fetch. This is the + * organization's relative path in the API, formatted as + * "organizations/[organizationId]". For example, "organizations/1234". + * + * 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 resource name of the Organization to fetch. This is the + * organization's relative path in the API, formatted as + * "organizations/[organizationId]". For example, "organizations/1234". + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetProjectRequest.php new file mode 100644 index 000000000000..1cd344d81e30 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetProjectRequest.php @@ -0,0 +1,69 @@ +google.cloud.resourcemanager.v3.GetProjectRequest + */ +class GetProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project (for example, `projects/415104041262`). + * + * 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 project (for example, `projects/415104041262`). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project (for example, `projects/415104041262`). + * + * 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 project (for example, `projects/415104041262`). + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagKeyRequest.php new file mode 100644 index 000000000000..e40147b894e8 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagKeyRequest.php @@ -0,0 +1,71 @@ +google.cloud.resourcemanager.v3.GetTagKeyRequest + */ +class GetTagKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A resource name in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * + * 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. A resource name in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + + /** + * Required. A resource name in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * + * 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. A resource name in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagValueRequest.php new file mode 100644 index 000000000000..2521df4b391c --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagValueRequest.php @@ -0,0 +1,71 @@ +google.cloud.resourcemanager.v3.GetTagValueRequest + */ +class GetTagValueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name for TagValue to be fetched in the format + * `tagValues/456`. + * + * 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. Resource name for TagValue to be fetched in the format + * `tagValues/456`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name for TagValue to be fetched in the format + * `tagValues/456`. + * + * 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. Resource name for TagValue to be fetched in the format + * `tagValues/456`. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsRequest.php new file mode 100644 index 000000000000..e3ca4d2a48ba --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsRequest.php @@ -0,0 +1,155 @@ +google.cloud.resourcemanager.v3.ListEffectiveTagsRequest + */ +class ListEffectiveTagsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full resource name of a resource for which you want to list + * the effective tags. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Optional. The maximum number of effective tags to return in the response. + * The server allows a maximum of 300 effective tags to return in a single + * page. If unspecified, the server will use 100 as the default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A pagination token returned from a previous call to + * `ListEffectiveTags` that indicates from where this listing should continue. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The full resource name of a resource for which you want to list + * the effective tags. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * @type int $page_size + * Optional. The maximum number of effective tags to return in the response. + * The server allows a maximum of 300 effective tags to return in a single + * page. If unspecified, the server will use 100 as the default. + * @type string $page_token + * Optional. A pagination token returned from a previous call to + * `ListEffectiveTags` that indicates from where this listing should continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full resource name of a resource for which you want to list + * the effective tags. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The full resource name of a resource for which you want to list + * the effective tags. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of effective tags to return in the response. + * The server allows a maximum of 300 effective tags to return in a single + * page. If unspecified, the server will use 100 as the default. + * + * 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 effective tags to return in the response. + * The server allows a maximum of 300 effective tags to return in a single + * page. If unspecified, the server will use 100 as the default. + * + * 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. A pagination token returned from a previous call to + * `ListEffectiveTags` that indicates from where this listing should continue. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to + * `ListEffectiveTags` that indicates from where this listing should continue. + * + * 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; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsResponse.php new file mode 100644 index 000000000000..8c970dbe1d03 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsResponse.php @@ -0,0 +1,129 @@ +google.cloud.resourcemanager.v3.ListEffectiveTagsResponse + */ +class ListEffectiveTagsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A possibly paginated list of effective tags for the specified resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.EffectiveTag effective_tags = 1; + */ + private $effective_tags; + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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\ResourceManager\V3\EffectiveTag>|\Google\Protobuf\Internal\RepeatedField $effective_tags + * A possibly paginated list of effective tags for the specified resource. + * @type string $next_page_token + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + + /** + * A possibly paginated list of effective tags for the specified resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.EffectiveTag effective_tags = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEffectiveTags() + { + return $this->effective_tags; + } + + /** + * A possibly paginated list of effective tags for the specified resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.EffectiveTag effective_tags = 1; + * @param array<\Google\Cloud\ResourceManager\V3\EffectiveTag>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEffectiveTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\EffectiveTag::class); + $this->effective_tags = $arr; + + return $this; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersRequest.php new file mode 100644 index 000000000000..a928f5732fd7 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersRequest.php @@ -0,0 +1,213 @@ +google.cloud.resourcemanager.v3.ListFoldersRequest + */ +class ListFoldersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource whose folders are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * Access to this method is controlled by checking the + * `resourcemanager.folders.list` permission on the `parent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of folders to return in the response. The + * server can return fewer folders than requested. If unspecified, server + * picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A pagination token returned from a previous call to `ListFolders` + * that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Controls whether folders in the + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + * state should be returned. Defaults to false. + * + * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $show_deleted = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource whose folders are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * Access to this method is controlled by checking the + * `resourcemanager.folders.list` permission on the `parent`. + * @type int $page_size + * Optional. The maximum number of folders to return in the response. The + * server can return fewer folders than requested. If unspecified, server + * picks an appropriate default. + * @type string $page_token + * Optional. A pagination token returned from a previous call to `ListFolders` + * that indicates where this listing should continue from. + * @type bool $show_deleted + * Optional. Controls whether folders in the + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + * state should be returned. Defaults to false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource whose folders are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * Access to this method is controlled by checking the + * `resourcemanager.folders.list` permission on the `parent`. + * + * 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 name of the parent resource whose folders are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * Access to this method is controlled by checking the + * `resourcemanager.folders.list` permission on the `parent`. + * + * 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 folders to return in the response. The + * server can return fewer folders than requested. If unspecified, server + * picks an appropriate default. + * + * 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 folders to return in the response. The + * server can return fewer folders than requested. If unspecified, server + * picks an appropriate default. + * + * 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. A pagination token returned from a previous call to `ListFolders` + * that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to `ListFolders` + * that indicates where this listing should continue from. + * + * 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. Controls whether folders in the + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + * state should be returned. Defaults to false. + * + * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * Optional. Controls whether folders in the + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + * state should be returned. Defaults to false. + * + * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersResponse.php new file mode 100644 index 000000000000..72d6127db518 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersResponse.php @@ -0,0 +1,109 @@ +google.cloud.resourcemanager.v3.ListFoldersResponse + */ +class ListFoldersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A possibly paginated list of folders that are direct descendants of + * the specified parent resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + private $folders; + /** + * A pagination token returned from a previous call to `ListFolders` + * that indicates from where listing should continue. + * + * 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\ResourceManager\V3\Folder>|\Google\Protobuf\Internal\RepeatedField $folders + * A possibly paginated list of folders that are direct descendants of + * the specified parent resource. + * @type string $next_page_token + * A pagination token returned from a previous call to `ListFolders` + * that indicates from where listing should continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * A possibly paginated list of folders that are direct descendants of + * the specified parent resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFolders() + { + return $this->folders; + } + + /** + * A possibly paginated list of folders that are direct descendants of + * the specified parent resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + * @param array<\Google\Cloud\ResourceManager\V3\Folder>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFolders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Folder::class); + $this->folders = $arr; + + return $this; + } + + /** + * A pagination token returned from a previous call to `ListFolders` + * that indicates from where listing should continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A pagination token returned from a previous call to `ListFolders` + * that indicates from where listing should continue. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsRequest.php new file mode 100644 index 000000000000..0efd11bc7918 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsRequest.php @@ -0,0 +1,207 @@ +google.cloud.resourcemanager.v3.ListProjectsRequest + */ +class ListProjectsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource whose projects are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. A pagination token returned from a previous call to + * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + * indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Indicate that projects in the `DELETE_REQUESTED` state should + * also be returned. Normally only `ACTIVE` projects are returned. + * + * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $show_deleted = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource whose projects are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * @type string $page_token + * Optional. A pagination token returned from a previous call to + * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + * indicates from where listing should continue. + * @type int $page_size + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * @type bool $show_deleted + * Optional. Indicate that projects in the `DELETE_REQUESTED` state should + * also be returned. Normally only `ACTIVE` projects are returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource whose projects are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * + * 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 name of the parent resource whose projects are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * + * 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. A pagination token returned from a previous call to + * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + * indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to + * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + * indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.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 maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. Indicate that projects in the `DELETE_REQUESTED` state should + * also be returned. Normally only `ACTIVE` projects are returned. + * + * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * Optional. Indicate that projects in the `DELETE_REQUESTED` state should + * also be returned. Normally only `ACTIVE` projects are returned. + * + * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsResponse.php new file mode 100644 index 000000000000..4714956716e4 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsResponse.php @@ -0,0 +1,136 @@ +google.cloud.resourcemanager.v3.ListProjectsResponse + */ +class ListProjectsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Projects under the parent. This list can be paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + private $projects; + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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\ResourceManager\V3\Project>|\Google\Protobuf\Internal\RepeatedField $projects + * The list of Projects under the parent. This list can be paginated. + * @type string $next_page_token + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * The list of Projects under the parent. This list can be paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProjects() + { + return $this->projects; + } + + /** + * The list of Projects under the parent. This list can be paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; + * @param array<\Google\Cloud\ResourceManager\V3\Project>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProjects($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Project::class); + $this->projects = $arr; + + return $this; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsRequest.php new file mode 100644 index 000000000000..71f7a8f5745f --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsRequest.php @@ -0,0 +1,155 @@ +google.cloud.resourcemanager.v3.ListTagBindingsRequest + */ +class ListTagBindingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full resource name of a resource for which you want to list + * existing TagBindings. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of TagBindings to return in the response. The + * server allows a maximum of 300 TagBindings to return. If unspecified, the + * server will use 100 as the default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A pagination token returned from a previous call to + * `ListTagBindings` that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The full resource name of a resource for which you want to list + * existing TagBindings. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * @type int $page_size + * Optional. The maximum number of TagBindings to return in the response. The + * server allows a maximum of 300 TagBindings to return. If unspecified, the + * server will use 100 as the default. + * @type string $page_token + * Optional. A pagination token returned from a previous call to + * `ListTagBindings` that indicates where this listing should continue from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full resource name of a resource for which you want to list + * existing TagBindings. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * + * 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 full resource name of a resource for which you want to list + * existing TagBindings. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * + * 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 TagBindings to return in the response. The + * server allows a maximum of 300 TagBindings to return. If unspecified, the + * server will use 100 as the default. + * + * 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 TagBindings to return in the response. The + * server allows a maximum of 300 TagBindings to return. If unspecified, the + * server will use 100 as the default. + * + * 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. A pagination token returned from a previous call to + * `ListTagBindings` that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to + * `ListTagBindings` that indicates where this listing should continue from. + * + * 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; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsResponse.php new file mode 100644 index 000000000000..f71e67a1f327 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsResponse.php @@ -0,0 +1,129 @@ +google.cloud.resourcemanager.v3.ListTagBindingsResponse + */ +class ListTagBindingsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A possibly paginated list of TagBindings for the specified resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + private $tag_bindings; + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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\ResourceManager\V3\TagBinding>|\Google\Protobuf\Internal\RepeatedField $tag_bindings + * A possibly paginated list of TagBindings for the specified resource. + * @type string $next_page_token + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + + /** + * A possibly paginated list of TagBindings for the specified resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTagBindings() + { + return $this->tag_bindings; + } + + /** + * A possibly paginated list of TagBindings for the specified resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + * @param array<\Google\Cloud\ResourceManager\V3\TagBinding>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTagBindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\TagBinding::class); + $this->tag_bindings = $arr; + + return $this; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsRequest.php new file mode 100644 index 000000000000..0817ca7697ea --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsRequest.php @@ -0,0 +1,221 @@ +google.cloud.resourcemanager.v3.ListTagHoldsRequest + */ +class ListTagHoldsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the parent TagValue. Must be of the form: + * `tagValues/{tag-value-id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of TagHolds to return in the response. The + * server allows a maximum of 300 TagHolds to return. If unspecified, the + * server will use 100 as the default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A pagination token returned from a previous call to + * `ListTagHolds` that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Criteria used to select a subset of TagHolds parented by the + * TagValue to return. This field follows the syntax defined by aip.dev/160; + * the `holder` and `origin` fields are supported for filtering. Currently + * only `AND` syntax is supported. Some example queries are: + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + * * `origin = 35678234` + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group + * AND origin = 35678234` + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the parent TagValue. Must be of the form: + * `tagValues/{tag-value-id}`. + * @type int $page_size + * Optional. The maximum number of TagHolds to return in the response. The + * server allows a maximum of 300 TagHolds to return. If unspecified, the + * server will use 100 as the default. + * @type string $page_token + * Optional. A pagination token returned from a previous call to + * `ListTagHolds` that indicates where this listing should continue from. + * @type string $filter + * Optional. Criteria used to select a subset of TagHolds parented by the + * TagValue to return. This field follows the syntax defined by aip.dev/160; + * the `holder` and `origin` fields are supported for filtering. Currently + * only `AND` syntax is supported. Some example queries are: + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + * * `origin = 35678234` + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group + * AND origin = 35678234` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the parent TagValue. Must be of the form: + * `tagValues/{tag-value-id}`. + * + * 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 parent TagValue. Must be of the form: + * `tagValues/{tag-value-id}`. + * + * 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 TagHolds to return in the response. The + * server allows a maximum of 300 TagHolds to return. If unspecified, the + * server will use 100 as the default. + * + * 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 TagHolds to return in the response. The + * server allows a maximum of 300 TagHolds to return. If unspecified, the + * server will use 100 as the default. + * + * 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. A pagination token returned from a previous call to + * `ListTagHolds` that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to + * `ListTagHolds` that indicates where this listing should continue from. + * + * 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. Criteria used to select a subset of TagHolds parented by the + * TagValue to return. This field follows the syntax defined by aip.dev/160; + * the `holder` and `origin` fields are supported for filtering. Currently + * only `AND` syntax is supported. Some example queries are: + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + * * `origin = 35678234` + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group + * AND origin = 35678234` + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Criteria used to select a subset of TagHolds parented by the + * TagValue to return. This field follows the syntax defined by aip.dev/160; + * the `holder` and `origin` fields are supported for filtering. Currently + * only `AND` syntax is supported. Some example queries are: + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + * * `origin = 35678234` + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group + * AND origin = 35678234` + * + * 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; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsResponse.php new file mode 100644 index 000000000000..8d12cbcf0492 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsResponse.php @@ -0,0 +1,129 @@ +google.cloud.resourcemanager.v3.ListTagHoldsResponse + */ +class ListTagHoldsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A possibly paginated list of TagHolds. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagHold tag_holds = 1; + */ + private $tag_holds; + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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\ResourceManager\V3\TagHold>|\Google\Protobuf\Internal\RepeatedField $tag_holds + * A possibly paginated list of TagHolds. + * @type string $next_page_token + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); + parent::__construct($data); + } + + /** + * A possibly paginated list of TagHolds. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagHold tag_holds = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTagHolds() + { + return $this->tag_holds; + } + + /** + * A possibly paginated list of TagHolds. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagHold tag_holds = 1; + * @param array<\Google\Cloud\ResourceManager\V3\TagHold>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTagHolds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\TagHold::class); + $this->tag_holds = $arr; + + return $this; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysRequest.php new file mode 100644 index 000000000000..e41be45ff994 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysRequest.php @@ -0,0 +1,155 @@ +google.cloud.resourcemanager.v3.ListTagKeysRequest + */ +class ListTagKeysRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the TagKey's parent. + * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + * `projects/{project_number}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of TagKeys to return in the response. The + * server allows a maximum of 300 TagKeys to return. If unspecified, the + * server will use 100 as the default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A pagination token returned from a previous call to `ListTagKey` + * that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the TagKey's parent. + * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + * `projects/{project_number}` + * @type int $page_size + * Optional. The maximum number of TagKeys to return in the response. The + * server allows a maximum of 300 TagKeys to return. If unspecified, the + * server will use 100 as the default. + * @type string $page_token + * Optional. A pagination token returned from a previous call to `ListTagKey` + * that indicates where this listing should continue from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the TagKey's parent. + * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + * `projects/{project_number}` + * + * 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 TagKey's parent. + * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + * `projects/{project_number}` + * + * 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 TagKeys to return in the response. The + * server allows a maximum of 300 TagKeys to return. If unspecified, the + * server will use 100 as the default. + * + * 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 TagKeys to return in the response. The + * server allows a maximum of 300 TagKeys to return. If unspecified, the + * server will use 100 as the default. + * + * 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. A pagination token returned from a previous call to `ListTagKey` + * that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to `ListTagKey` + * that indicates where this listing should continue from. + * + * 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; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysResponse.php new file mode 100644 index 000000000000..ff989a9f578f --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysResponse.php @@ -0,0 +1,105 @@ +google.cloud.resourcemanager.v3.ListTagKeysResponse + */ +class ListTagKeysResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of TagKeys that live under the specified parent in the request. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + private $tag_keys; + /** + * A pagination token returned from a previous call to `ListTagKeys` + * that indicates from where listing should continue. + * + * 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\ResourceManager\V3\TagKey>|\Google\Protobuf\Internal\RepeatedField $tag_keys + * List of TagKeys that live under the specified parent in the request. + * @type string $next_page_token + * A pagination token returned from a previous call to `ListTagKeys` + * that indicates from where listing should continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + + /** + * List of TagKeys that live under the specified parent in the request. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTagKeys() + { + return $this->tag_keys; + } + + /** + * List of TagKeys that live under the specified parent in the request. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + * @param array<\Google\Cloud\ResourceManager\V3\TagKey>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTagKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\TagKey::class); + $this->tag_keys = $arr; + + return $this; + } + + /** + * A pagination token returned from a previous call to `ListTagKeys` + * that indicates from where listing should continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A pagination token returned from a previous call to `ListTagKeys` + * that indicates from where listing should continue. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesRequest.php new file mode 100644 index 000000000000..435deccc0b7d --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesRequest.php @@ -0,0 +1,149 @@ +google.cloud.resourcemanager.v3.ListTagValuesRequest + */ +class ListTagValuesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of TagValues to return in the response. The + * server allows a maximum of 300 TagValues to return. If unspecified, the + * server will use 100 as the default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A pagination token returned from a previous call to + * `ListTagValues` that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. + * @type int $page_size + * Optional. The maximum number of TagValues to return in the response. The + * server allows a maximum of 300 TagValues to return. If unspecified, the + * server will use 100 as the default. + * @type string $page_token + * Optional. A pagination token returned from a previous call to + * `ListTagValues` that indicates where this listing should continue from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + + /** + * Required. + * + * 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. + * + * 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 TagValues to return in the response. The + * server allows a maximum of 300 TagValues to return. If unspecified, the + * server will use 100 as the default. + * + * 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 TagValues to return in the response. The + * server allows a maximum of 300 TagValues to return. If unspecified, the + * server will use 100 as the default. + * + * 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. A pagination token returned from a previous call to + * `ListTagValues` that indicates where this listing should continue from. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to + * `ListTagValues` that indicates where this listing should continue from. + * + * 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; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesResponse.php new file mode 100644 index 000000000000..ff490de7417a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesResponse.php @@ -0,0 +1,113 @@ +google.cloud.resourcemanager.v3.ListTagValuesResponse + */ +class ListTagValuesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A possibly paginated list of TagValues that are direct descendants of + * the specified parent TagKey. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + private $tag_values; + /** + * A pagination token returned from a previous call to `ListTagValues` + * that indicates from where listing should continue. This is currently not + * used, but the server may at any point start supplying a valid token. + * + * 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\ResourceManager\V3\TagValue>|\Google\Protobuf\Internal\RepeatedField $tag_values + * A possibly paginated list of TagValues that are direct descendants of + * the specified parent TagKey. + * @type string $next_page_token + * A pagination token returned from a previous call to `ListTagValues` + * that indicates from where listing should continue. This is currently not + * used, but the server may at any point start supplying a valid token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + + /** + * A possibly paginated list of TagValues that are direct descendants of + * the specified parent TagKey. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTagValues() + { + return $this->tag_values; + } + + /** + * A possibly paginated list of TagValues that are direct descendants of + * the specified parent TagKey. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + * @param array<\Google\Cloud\ResourceManager\V3\TagValue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTagValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\TagValue::class); + $this->tag_values = $arr; + + return $this; + } + + /** + * A pagination token returned from a previous call to `ListTagValues` + * that indicates from where listing should continue. This is currently not + * used, but the server may at any point start supplying a valid token. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A pagination token returned from a previous call to `ListTagValues` + * that indicates from where listing should continue. This is currently not + * used, but the server may at any point start supplying a valid token. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderMetadata.php new file mode 100644 index 000000000000..da8f8448b18a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderMetadata.php @@ -0,0 +1,135 @@ +google.cloud.resourcemanager.v3.MoveFolderMetadata + */ +class MoveFolderMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The display name of the folder. + * + * Generated from protobuf field string display_name = 1; + */ + protected $display_name = ''; + /** + * The resource name of the folder's parent. + * + * Generated from protobuf field string source_parent = 2; + */ + protected $source_parent = ''; + /** + * The resource name of the folder or organization to move the folder to. + * + * Generated from protobuf field string destination_parent = 3; + */ + protected $destination_parent = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * The display name of the folder. + * @type string $source_parent + * The resource name of the folder's parent. + * @type string $destination_parent + * The resource name of the folder or organization to move the folder to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * The display name of the folder. + * + * Generated from protobuf field string display_name = 1; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The display name of the folder. + * + * Generated from protobuf field string display_name = 1; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The resource name of the folder's parent. + * + * Generated from protobuf field string source_parent = 2; + * @return string + */ + public function getSourceParent() + { + return $this->source_parent; + } + + /** + * The resource name of the folder's parent. + * + * Generated from protobuf field string source_parent = 2; + * @param string $var + * @return $this + */ + public function setSourceParent($var) + { + GPBUtil::checkString($var, True); + $this->source_parent = $var; + + return $this; + } + + /** + * The resource name of the folder or organization to move the folder to. + * + * Generated from protobuf field string destination_parent = 3; + * @return string + */ + public function getDestinationParent() + { + return $this->destination_parent; + } + + /** + * The resource name of the folder or organization to move the folder to. + * + * Generated from protobuf field string destination_parent = 3; + * @param string $var + * @return $this + */ + public function setDestinationParent($var) + { + GPBUtil::checkString($var, True); + $this->destination_parent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderRequest.php new file mode 100644 index 000000000000..0a3c7f37543d --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderRequest.php @@ -0,0 +1,113 @@ +google.cloud.resourcemanager.v3.MoveFolderRequest + */ +class MoveFolderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Folder to move. + * Must be of the form folders/{folder_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The resource name of the folder or organization which should be + * the folder's new parent. Must be of the form `folders/{folder_id}` or + * `organizations/{org_id}`. + * + * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $destination_parent = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Folder to move. + * Must be of the form folders/{folder_id} + * @type string $destination_parent + * Required. The resource name of the folder or organization which should be + * the folder's new parent. Must be of the form `folders/{folder_id}` or + * `organizations/{org_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Folder to move. + * Must be of the form folders/{folder_id} + * + * 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 resource name of the Folder to move. + * Must be of the form folders/{folder_id} + * + * 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; + } + + /** + * Required. The resource name of the folder or organization which should be + * the folder's new parent. Must be of the form `folders/{folder_id}` or + * `organizations/{org_id}`. + * + * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getDestinationParent() + { + return $this->destination_parent; + } + + /** + * Required. The resource name of the folder or organization which should be + * the folder's new parent. Must be of the form `folders/{folder_id}` or + * `organizations/{org_id}`. + * + * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDestinationParent($var) + { + GPBUtil::checkString($var, True); + $this->destination_parent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectMetadata.php new file mode 100644 index 000000000000..4dc990631f48 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.MoveProjectMetadata + */ +class MoveProjectMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectRequest.php new file mode 100644 index 000000000000..fa5ea46e2db8 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectRequest.php @@ -0,0 +1,103 @@ +google.cloud.resourcemanager.v3.MoveProjectRequest + */ +class MoveProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project to move. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The new parent to move the Project under. + * + * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $destination_parent = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the project to move. + * @type string $destination_parent + * Required. The new parent to move the Project under. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project to move. + * + * 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 project to move. + * + * 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; + } + + /** + * Required. The new parent to move the Project under. + * + * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getDestinationParent() + { + return $this->destination_parent; + } + + /** + * Required. The new parent to move the Project under. + * + * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDestinationParent($var) + { + GPBUtil::checkString($var, True); + $this->destination_parent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization.php new file mode 100644 index 000000000000..d641338f6e82 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization.php @@ -0,0 +1,372 @@ +google.cloud.resourcemanager.v3.Organization + */ +class Organization extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the organization. This is the + * organization's relative path in the API. Its format is + * "organizations/[organization_id]". For example, "organizations/1234". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. A human-readable string that refers to the organization in the + * Google Cloud Console. This string is set by the server and cannot be + * changed. The string will be set to the primary domain (for example, + * "google.com") of the Google Workspace customer that owns the organization. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $display_name = ''; + /** + * Output only. The organization's current lifecycle state. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. Timestamp when the Organization was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Timestamp when the Organization was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Timestamp when the Organization was requested for deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. A checksum computed by the server based on the current value + * of the Organization resource. This may be sent on update and delete + * requests to ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $etag = ''; + protected $owner; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the organization. This is the + * organization's relative path in the API. Its format is + * "organizations/[organization_id]". For example, "organizations/1234". + * @type string $display_name + * Output only. A human-readable string that refers to the organization in the + * Google Cloud Console. This string is set by the server and cannot be + * changed. The string will be set to the primary domain (for example, + * "google.com") of the Google Workspace customer that owns the organization. + * @type string $directory_customer_id + * Immutable. The G Suite / Workspace customer id used in the Directory API. + * @type int $state + * Output only. The organization's current lifecycle state. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Timestamp when the Organization was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Timestamp when the Organization was last modified. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. Timestamp when the Organization was requested for deletion. + * @type string $etag + * Output only. A checksum computed by the server based on the current value + * of the Organization resource. This may be sent on update and delete + * requests to ensure the client has an up-to-date value before proceeding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the organization. This is the + * organization's relative path in the API. Its format is + * "organizations/[organization_id]". For example, "organizations/1234". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the organization. This is the + * organization's relative path in the API. Its format is + * "organizations/[organization_id]". For example, "organizations/1234". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. A human-readable string that refers to the organization in the + * Google Cloud Console. This string is set by the server and cannot be + * changed. The string will be set to the primary domain (for example, + * "google.com") of the Google Workspace customer that owns the organization. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Output only. A human-readable string that refers to the organization in the + * Google Cloud Console. This string is set by the server and cannot be + * changed. The string will be set to the primary domain (for example, + * "google.com") of the Google Workspace customer that owns the organization. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Immutable. The G Suite / Workspace customer id used in the Directory API. + * + * Generated from protobuf field string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getDirectoryCustomerId() + { + return $this->readOneof(3); + } + + public function hasDirectoryCustomerId() + { + return $this->hasOneof(3); + } + + /** + * Immutable. The G Suite / Workspace customer id used in the Directory API. + * + * Generated from protobuf field string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setDirectoryCustomerId($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Output only. The organization's current lifecycle state. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The organization's current lifecycle state. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V3\Organization\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Timestamp when the Organization was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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. Timestamp when the Organization was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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. Timestamp when the Organization was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.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. Timestamp when the Organization was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.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. Timestamp when the Organization was requested for deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. Timestamp when the Organization was requested for deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. A checksum computed by the server based on the current value + * of the Organization resource. This may be sent on update and delete + * requests to ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. A checksum computed by the server based on the current value + * of the Organization resource. This may be sent on update and delete + * requests to ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * @return string + */ + public function getOwner() + { + return $this->whichOneof("owner"); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization/State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization/State.php new file mode 100644 index 000000000000..afee81887ea8 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization/State.php @@ -0,0 +1,64 @@ +google.cloud.resourcemanager.v3.Organization.State + */ +class State +{ + /** + * Unspecified state. This is only useful for distinguishing unset values. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The normal and active state. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * The organization has been marked for deletion by the user. + * + * Generated from protobuf enum DELETE_REQUESTED = 2; + */ + const DELETE_REQUESTED = 2; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::DELETE_REQUESTED => 'DELETE_REQUESTED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\ResourceManager\V3\Organization_State::class); + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization_State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization_State.php new file mode 100644 index 000000000000..148af4e0c1e7 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization_State.php @@ -0,0 +1,16 @@ +_simpleRequest('/google.cloud.resourcemanager.v3.Organizations/GetOrganization', + $argument, + ['\Google\Cloud\ResourceManager\V3\Organization', 'decode'], + $metadata, $options); + } + + /** + * Searches organization resources that are visible to the user and satisfy + * the specified filter. This method returns organizations in an unspecified + * order. New organizations do not necessarily appear at the end of the + * results, and may take a small amount of time to appear. + * + * Search will only return organizations on which the user has the permission + * `resourcemanager.organizations.get` + * @param \Google\Cloud\ResourceManager\V3\SearchOrganizationsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function SearchOrganizations(\Google\Cloud\ResourceManager\V3\SearchOrganizationsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Organizations/SearchOrganizations', + $argument, + ['\Google\Cloud\ResourceManager\V3\SearchOrganizationsResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets the access control policy for an organization resource. The policy may + * be empty if no such policy or resource exists. The `resource` field should + * be the organization's resource name, for example: "organizations/123". + * + * Authorization requires the IAM permission + * `resourcemanager.organizations.getIamPolicy` on the specified organization. + * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Organizations/GetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * Sets the access control policy on an organization resource. Replaces any + * existing policy. The `resource` field should be the organization's resource + * name, for example: "organizations/123". + * + * Authorization requires the IAM permission + * `resourcemanager.organizations.setIamPolicy` on the specified organization. + * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Organizations/SetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * Returns the permissions that a caller has on the specified organization. + * The `resource` field should be the organization's resource name, + * for example: "organizations/123". + * + * There are no permissions required for making this API call. + * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Organizations/TestIamPermissions', + $argument, + ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project.php new file mode 100644 index 000000000000..066d475cb2f9 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project.php @@ -0,0 +1,489 @@ +google.cloud.resourcemanager.v3.Project + */ +class Project extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique resource name of the project. It is an int64 + * generated number prefixed by "projects/". + * Example: `projects/415104041262` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Optional. A reference to a parent Resource. eg., `organizations/123` or + * `folders/876`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $parent = ''; + /** + * Immutable. The unique, user-assigned id of the project. + * It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. + * It must start with a letter. + * Trailing hyphens are prohibited. + * Example: `tokyo-rain-123` + * + * Generated from protobuf field string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $project_id = ''; + /** + * Output only. The project lifecycle state. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. A user-assigned display name of the project. + * When present it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, single-quote, double-quote, space, and exclamation point. + * Example: `My Project` + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Output only. Creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The most recent time this resource was modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. The time at which this resource was requested for deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. A checksum computed by the server based on the current value + * of the Project resource. This may be sent on update and delete requests to + * ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $etag = ''; + /** + * Optional. The labels associated with this project. + * Label keys must be between 1 and 63 characters long and must conform + * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. + * Label values must be between 0 and 63 characters long and must conform + * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. + * No more than 64 labels can be associated with a given resource. + * Clients should store labels in a representation such as JSON that does not + * depend on specific characters being disallowed. + * Example: `"myBusinessDimension" : "businessValue"` + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The unique resource name of the project. It is an int64 + * generated number prefixed by "projects/". + * Example: `projects/415104041262` + * @type string $parent + * Optional. A reference to a parent Resource. eg., `organizations/123` or + * `folders/876`. + * @type string $project_id + * Immutable. The unique, user-assigned id of the project. + * It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. + * It must start with a letter. + * Trailing hyphens are prohibited. + * Example: `tokyo-rain-123` + * @type int $state + * Output only. The project lifecycle state. + * @type string $display_name + * Optional. A user-assigned display name of the project. + * When present it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, single-quote, double-quote, space, and exclamation point. + * Example: `My Project` + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The most recent time this resource was modified. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. The time at which this resource was requested for deletion. + * @type string $etag + * Output only. A checksum computed by the server based on the current value + * of the Project resource. This may be sent on update and delete requests to + * ensure the client has an up-to-date value before proceeding. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. The labels associated with this project. + * Label keys must be between 1 and 63 characters long and must conform + * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. + * Label values must be between 0 and 63 characters long and must conform + * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. + * No more than 64 labels can be associated with a given resource. + * Clients should store labels in a representation such as JSON that does not + * depend on specific characters being disallowed. + * Example: `"myBusinessDimension" : "businessValue"` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique resource name of the project. It is an int64 + * generated number prefixed by "projects/". + * Example: `projects/415104041262` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique resource name of the project. It is an int64 + * generated number prefixed by "projects/". + * Example: `projects/415104041262` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. A reference to a parent Resource. eg., `organizations/123` or + * `folders/876`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Optional. A reference to a parent Resource. eg., `organizations/123` or + * `folders/876`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Immutable. The unique, user-assigned id of the project. + * It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. + * It must start with a letter. + * Trailing hyphens are prohibited. + * Example: `tokyo-rain-123` + * + * Generated from protobuf field string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Immutable. The unique, user-assigned id of the project. + * It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. + * It must start with a letter. + * Trailing hyphens are prohibited. + * Example: `tokyo-rain-123` + * + * Generated from protobuf field string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * Output only. The project lifecycle state. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The project lifecycle state. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V3\Project\State::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. A user-assigned display name of the project. + * When present it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, single-quote, double-quote, space, and exclamation point. + * Example: `My Project` + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. A user-assigned display name of the project. + * When present it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, single-quote, double-quote, space, and exclamation point. + * Example: `My Project` + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. Creation time. + * + * 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. Creation time. + * + * 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 most recent time this resource was modified. + * + * 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 most recent time this resource was modified. + * + * 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. The time at which this resource was requested for deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. The time at which this resource was requested for deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. A checksum computed by the server based on the current value + * of the Project resource. This may be sent on update and delete requests to + * ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. A checksum computed by the server based on the current value + * of the Project resource. This may be sent on update and delete requests to + * ensure the client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. The labels associated with this project. + * Label keys must be between 1 and 63 characters long and must conform + * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. + * Label values must be between 0 and 63 characters long and must conform + * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. + * No more than 64 labels can be associated with a given resource. + * Clients should store labels in a representation such as JSON that does not + * depend on specific characters being disallowed. + * Example: `"myBusinessDimension" : "businessValue"` + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. The labels associated with this project. + * Label keys must be between 1 and 63 characters long and must conform + * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. + * Label values must be between 0 and 63 characters long and must conform + * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. + * No more than 64 labels can be associated with a given resource. + * Clients should store labels in a representation such as JSON that does not + * depend on specific characters being disallowed. + * Example: `"myBusinessDimension" : "businessValue"` + * + * Generated from protobuf field map labels = 10 [(.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; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project/State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project/State.php new file mode 100644 index 000000000000..ce98594b31e5 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project/State.php @@ -0,0 +1,70 @@ +google.cloud.resourcemanager.v3.Project.State + */ +class State +{ + /** + * Unspecified state. This is only used/useful for distinguishing + * unset values. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The normal and active state. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * The project has been marked for deletion by the user + * (by invoking + * [DeleteProject][google.cloud.resourcemanager.v3.Projects.DeleteProject]) + * or by the system (Google Cloud Platform). + * This can generally be reversed by invoking [UndeleteProject] + * [google.cloud.resourcemanager.v3.Projects.UndeleteProject]. + * + * Generated from protobuf enum DELETE_REQUESTED = 2; + */ + const DELETE_REQUESTED = 2; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::DELETE_REQUESTED => 'DELETE_REQUESTED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\ResourceManager\V3\Project_State::class); + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project_State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project_State.php new file mode 100644 index 000000000000..7fd800c57905 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project_State.php @@ -0,0 +1,16 @@ +_simpleRequest('/google.cloud.resourcemanager.v3.Projects/GetProject', + $argument, + ['\Google\Cloud\ResourceManager\V3\Project', 'decode'], + $metadata, $options); + } + + /** + * Lists projects that are direct children of the specified folder or + * organization resource. `list()` provides a strongly consistent view of the + * projects underneath the specified parent resource. `list()` returns + * projects sorted based upon the (ascending) lexical ordering of their + * `display_name`. The caller must have `resourcemanager.projects.list` + * permission on the identified parent. + * @param \Google\Cloud\ResourceManager\V3\ListProjectsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListProjects(\Google\Cloud\ResourceManager\V3\ListProjectsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/ListProjects', + $argument, + ['\Google\Cloud\ResourceManager\V3\ListProjectsResponse', 'decode'], + $metadata, $options); + } + + /** + * Search for projects that the caller has both `resourcemanager.projects.get` + * permission on, and also satisfy the specified query. + * + * This method returns projects in an unspecified order. + * + * This method is eventually consistent with project mutations; this means + * that a newly created project may not appear in the results or recent + * updates to an existing project may not be reflected in the results. To + * retrieve the latest state of a project, use the + * [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject] method. + * @param \Google\Cloud\ResourceManager\V3\SearchProjectsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function SearchProjects(\Google\Cloud\ResourceManager\V3\SearchProjectsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/SearchProjects', + $argument, + ['\Google\Cloud\ResourceManager\V3\SearchProjectsResponse', 'decode'], + $metadata, $options); + } + + /** + * Request that a new project be created. The result is an `Operation` which + * can be used to track the creation process. This process usually takes a few + * seconds, but can sometimes take much longer. The tracking `Operation` is + * automatically deleted after a few hours, so there is no need to call + * `DeleteOperation`. + * @param \Google\Cloud\ResourceManager\V3\CreateProjectRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateProject(\Google\Cloud\ResourceManager\V3\CreateProjectRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/CreateProject', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Updates the `display_name` and labels of the project identified by the + * specified `name` (for example, `projects/415104041262`). Deleting all + * labels requires an update mask for labels field. + * + * The caller must have `resourcemanager.projects.update` permission for this + * project. + * @param \Google\Cloud\ResourceManager\V3\UpdateProjectRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateProject(\Google\Cloud\ResourceManager\V3\UpdateProjectRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/UpdateProject', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Move a project to another place in your resource hierarchy, under a new + * resource parent. + * + * Returns an operation which can be used to track the process of the project + * move workflow. + * Upon success, the `Operation.response` field will be populated with the + * moved project. + * + * The caller must have `resourcemanager.projects.move` permission on the + * project, on the project's current and proposed new parent. + * + * If project has no current parent, or it currently does not have an + * associated organization resource, you will also need the + * `resourcemanager.projects.setIamPolicy` permission in the project. + * + * + * @param \Google\Cloud\ResourceManager\V3\MoveProjectRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function MoveProject(\Google\Cloud\ResourceManager\V3\MoveProjectRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/MoveProject', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Marks the project identified by the specified + * `name` (for example, `projects/415104041262`) for deletion. + * + * This method will only affect the project if it has a lifecycle state of + * [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE]. + * + * This method changes the Project's lifecycle state from + * [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] + * to + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. + * The deletion starts at an unspecified time, + * at which point the Project is no longer accessible. + * + * Until the deletion completes, you can check the lifecycle state + * checked by retrieving the project with [GetProject] + * [google.cloud.resourcemanager.v3.Projects.GetProject], + * and the project remains visible to [ListProjects] + * [google.cloud.resourcemanager.v3.Projects.ListProjects]. + * However, you cannot update the project. + * + * After the deletion completes, the project is not retrievable by + * the [GetProject] + * [google.cloud.resourcemanager.v3.Projects.GetProject], + * [ListProjects] + * [google.cloud.resourcemanager.v3.Projects.ListProjects], and + * [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] + * methods. + * + * This method behaves idempotently, such that deleting a `DELETE_REQUESTED` + * project will not cause an error, but also won't do anything. + * + * The caller must have `resourcemanager.projects.delete` permissions for this + * project. + * @param \Google\Cloud\ResourceManager\V3\DeleteProjectRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteProject(\Google\Cloud\ResourceManager\V3\DeleteProjectRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/DeleteProject', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Restores the project identified by the specified + * `name` (for example, `projects/415104041262`). + * You can only use this method for a project that has a lifecycle state of + * [DELETE_REQUESTED] + * [Projects.State.DELETE_REQUESTED]. + * After deletion starts, the project cannot be restored. + * + * The caller must have `resourcemanager.projects.undelete` permission for + * this project. + * @param \Google\Cloud\ResourceManager\V3\UndeleteProjectRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UndeleteProject(\Google\Cloud\ResourceManager\V3\UndeleteProjectRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/UndeleteProject', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Returns the IAM access control policy for the specified project, in the + * format `projects/{ProjectIdOrNumber}` e.g. projects/123. + * Permission is denied if the policy or the resource do not exist. + * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/GetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * Sets the IAM access control policy for the specified project, in the + * format `projects/{ProjectIdOrNumber}` e.g. projects/123. + * + * CAUTION: This method will replace the existing policy, and cannot be used + * to append additional IAM settings. + * + * Note: Removing service accounts from policies or changing their roles can + * render services completely inoperable. It is important to understand how + * the service account is being used before removing or updating its roles. + * + * The following constraints apply when using `setIamPolicy()`: + * + * + Project does not support `allUsers` and `allAuthenticatedUsers` as + * `members` in a `Binding` of a `Policy`. + * + * + The owner role can be granted to a `user`, `serviceAccount`, or a group + * that is part of an organization. For example, + * group@myownpersonaldomain.com could be added as an owner to a project in + * the myownpersonaldomain.com organization, but not the examplepetstore.com + * organization. + * + * + Service accounts can be made owners of a project directly + * without any restrictions. However, to be added as an owner, a user must be + * invited using the Cloud Platform console and must accept the invitation. + * + * + A user cannot be granted the owner role using `setIamPolicy()`. The user + * must be granted the owner role using the Cloud Platform Console and must + * explicitly accept the invitation. + * + * + Invitations to grant the owner role cannot be sent using + * `setIamPolicy()`; + * they must be sent only using the Cloud Platform Console. + * + * + If the project is not part of an organization, there must be at least + * one owner who has accepted the Terms of Service (ToS) agreement in the + * policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner + * from the policy will fail. This restriction also applies to legacy + * projects that no longer have owners who have accepted the ToS. Edits to + * IAM policies will be rejected until the lack of a ToS-accepting owner is + * rectified. If the project is part of an organization, you can remove all + * owners, potentially making the organization inaccessible. + * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/SetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * Returns permissions that a caller has on the specified project, in the + * format `projects/{ProjectIdOrNumber}` e.g. projects/123.. + * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/TestIamPermissions', + $argument, + ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Purpose.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Purpose.php new file mode 100644 index 000000000000..77092359f1d1 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Purpose.php @@ -0,0 +1,66 @@ +google.cloud.resourcemanager.v3.Purpose + */ +class Purpose +{ + /** + * Unspecified purpose. + * + * Generated from protobuf enum PURPOSE_UNSPECIFIED = 0; + */ + const PURPOSE_UNSPECIFIED = 0; + /** + * Purpose for Compute Engine firewalls. + * A corresponding `purpose_data` should be set for the network the tag is + * intended for. The key should be `network` and the value should be in + * either of these two formats: + * - + * `https://www.googleapis.com/compute/{compute_version}/projects/{project_id}/global/networks/{network_id}` + * - `{project_id}/{network_name}` + * Examples: + * - + * `https://www.googleapis.com/compute/staging_v1/projects/fail-closed-load-testing/global/networks/6992953698831725600` + * - `fail-closed-load-testing/load-testing-network` + * + * Generated from protobuf enum GCE_FIREWALL = 1; + */ + const GCE_FIREWALL = 1; + + private static $valueToName = [ + self::PURPOSE_UNSPECIFIED => 'PURPOSE_UNSPECIFIED', + self::GCE_FIREWALL => 'GCE_FIREWALL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersRequest.php new file mode 100644 index 000000000000..d128a1023c2a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersRequest.php @@ -0,0 +1,247 @@ +google.cloud.resourcemanager.v3.SearchFoldersRequest + */ +class SearchFoldersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The maximum number of folders to return in the response. The + * server can return fewer folders than requested. If unspecified, server + * picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A pagination token returned from a previous call to + * `SearchFolders` that indicates from where search should continue. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Search criteria used to select the folders to return. + * If no search criteria is specified then all accessible folders will be + * returned. + * Query expressions can be used to restrict results based upon displayName, + * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + * can be used along with the suffix wildcard symbol `*`. + * The `displayName` field in a query expression should use escaped quotes + * for values that include whitespace to prevent unexpected behavior. + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------| + * | displayName | Filters by displayName. | + * | parent | Filters by parent (for example: folders/123). | + * | state, lifecycleState | Filters by state. | + * ``` + * Some example queries are: + * * Query `displayName=Test*` returns Folder resources whose display name + * starts with "Test". + * * Query `state=ACTIVE` returns Folder resources with + * `state` set to `ACTIVE`. + * * Query `parent=folders/123` returns Folder resources that have + * `folders/123` as a parent resource. + * * Query `parent=folders/123 AND state=ACTIVE` returns active + * Folder resources that have `folders/123` as a parent resource. + * * Query `displayName=\\"Test String\\"` returns Folder resources with + * display names that include both "Test" and "String". + * + * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $query = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $page_size + * Optional. The maximum number of folders to return in the response. The + * server can return fewer folders than requested. If unspecified, server + * picks an appropriate default. + * @type string $page_token + * Optional. A pagination token returned from a previous call to + * `SearchFolders` that indicates from where search should continue. + * @type string $query + * Optional. Search criteria used to select the folders to return. + * If no search criteria is specified then all accessible folders will be + * returned. + * Query expressions can be used to restrict results based upon displayName, + * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + * can be used along with the suffix wildcard symbol `*`. + * The `displayName` field in a query expression should use escaped quotes + * for values that include whitespace to prevent unexpected behavior. + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------| + * | displayName | Filters by displayName. | + * | parent | Filters by parent (for example: folders/123). | + * | state, lifecycleState | Filters by state. | + * ``` + * Some example queries are: + * * Query `displayName=Test*` returns Folder resources whose display name + * starts with "Test". + * * Query `state=ACTIVE` returns Folder resources with + * `state` set to `ACTIVE`. + * * Query `parent=folders/123` returns Folder resources that have + * `folders/123` as a parent resource. + * * Query `parent=folders/123 AND state=ACTIVE` returns active + * Folder resources that have `folders/123` as a parent resource. + * * Query `displayName=\\"Test String\\"` returns Folder resources with + * display names that include both "Test" and "String". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The maximum number of folders to return in the response. The + * server can return fewer folders than requested. If unspecified, server + * picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of folders to return in the response. The + * server can return fewer folders than requested. If unspecified, server + * picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A pagination token returned from a previous call to + * `SearchFolders` that indicates from where search should continue. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to + * `SearchFolders` that indicates from where search should continue. + * + * Generated from protobuf field string page_token = 2 [(.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. Search criteria used to select the folders to return. + * If no search criteria is specified then all accessible folders will be + * returned. + * Query expressions can be used to restrict results based upon displayName, + * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + * can be used along with the suffix wildcard symbol `*`. + * The `displayName` field in a query expression should use escaped quotes + * for values that include whitespace to prevent unexpected behavior. + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------| + * | displayName | Filters by displayName. | + * | parent | Filters by parent (for example: folders/123). | + * | state, lifecycleState | Filters by state. | + * ``` + * Some example queries are: + * * Query `displayName=Test*` returns Folder resources whose display name + * starts with "Test". + * * Query `state=ACTIVE` returns Folder resources with + * `state` set to `ACTIVE`. + * * Query `parent=folders/123` returns Folder resources that have + * `folders/123` as a parent resource. + * * Query `parent=folders/123 AND state=ACTIVE` returns active + * Folder resources that have `folders/123` as a parent resource. + * * Query `displayName=\\"Test String\\"` returns Folder resources with + * display names that include both "Test" and "String". + * + * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Optional. Search criteria used to select the folders to return. + * If no search criteria is specified then all accessible folders will be + * returned. + * Query expressions can be used to restrict results based upon displayName, + * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + * can be used along with the suffix wildcard symbol `*`. + * The `displayName` field in a query expression should use escaped quotes + * for values that include whitespace to prevent unexpected behavior. + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------| + * | displayName | Filters by displayName. | + * | parent | Filters by parent (for example: folders/123). | + * | state, lifecycleState | Filters by state. | + * ``` + * Some example queries are: + * * Query `displayName=Test*` returns Folder resources whose display name + * starts with "Test". + * * Query `state=ACTIVE` returns Folder resources with + * `state` set to `ACTIVE`. + * * Query `parent=folders/123` returns Folder resources that have + * `folders/123` as a parent resource. + * * Query `parent=folders/123 AND state=ACTIVE` returns active + * Folder resources that have `folders/123` as a parent resource. + * * Query `displayName=\\"Test String\\"` returns Folder resources with + * display names that include both "Test" and "String". + * + * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersResponse.php new file mode 100644 index 000000000000..39fe82fe3719 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersResponse.php @@ -0,0 +1,109 @@ +google.cloud.resourcemanager.v3.SearchFoldersResponse + */ +class SearchFoldersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A possibly paginated folder search results. + * the specified parent resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + private $folders; + /** + * A pagination token returned from a previous call to `SearchFolders` + * that indicates from where searching should continue. + * + * 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\ResourceManager\V3\Folder>|\Google\Protobuf\Internal\RepeatedField $folders + * A possibly paginated folder search results. + * the specified parent resource. + * @type string $next_page_token + * A pagination token returned from a previous call to `SearchFolders` + * that indicates from where searching should continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * A possibly paginated folder search results. + * the specified parent resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFolders() + { + return $this->folders; + } + + /** + * A possibly paginated folder search results. + * the specified parent resource. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + * @param array<\Google\Cloud\ResourceManager\V3\Folder>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFolders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Folder::class); + $this->folders = $arr; + + return $this; + } + + /** + * A pagination token returned from a previous call to `SearchFolders` + * that indicates from where searching should continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A pagination token returned from a previous call to `SearchFolders` + * that indicates from where searching should continue. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsRequest.php new file mode 100644 index 000000000000..8b23123ccbee --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsRequest.php @@ -0,0 +1,203 @@ +google.cloud.resourcemanager.v3.SearchOrganizationsRequest + */ +class SearchOrganizationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The maximum number of organizations to return in the response. + * The server can return fewer organizations than requested. If unspecified, + * server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A pagination token returned from a previous call to + * `SearchOrganizations` that indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. An optional query string used to filter the Organizations to + * return in the response. Query rules are case-insensitive. + * ``` + * | Field | Description | + * |------------------|--------------------------------------------| + * | directoryCustomerId, owner.directoryCustomerId | Filters by directory + * customer id. | + * | domain | Filters by domain. | + * ``` + * Organizations may be queried by `directoryCustomerId` or by + * `domain`, where the domain is a G Suite domain, for example: + * * Query `directorycustomerid:123456789` returns Organization + * resources with `owner.directory_customer_id` equal to `123456789`. + * * Query `domain:google.com` returns Organization resources corresponding + * to the domain `google.com`. + * + * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $query = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $page_size + * Optional. The maximum number of organizations to return in the response. + * The server can return fewer organizations than requested. If unspecified, + * server picks an appropriate default. + * @type string $page_token + * Optional. A pagination token returned from a previous call to + * `SearchOrganizations` that indicates from where listing should continue. + * @type string $query + * Optional. An optional query string used to filter the Organizations to + * return in the response. Query rules are case-insensitive. + * ``` + * | Field | Description | + * |------------------|--------------------------------------------| + * | directoryCustomerId, owner.directoryCustomerId | Filters by directory + * customer id. | + * | domain | Filters by domain. | + * ``` + * Organizations may be queried by `directoryCustomerId` or by + * `domain`, where the domain is a G Suite domain, for example: + * * Query `directorycustomerid:123456789` returns Organization + * resources with `owner.directory_customer_id` equal to `123456789`. + * * Query `domain:google.com` returns Organization resources corresponding + * to the domain `google.com`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The maximum number of organizations to return in the response. + * The server can return fewer organizations than requested. If unspecified, + * server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of organizations to return in the response. + * The server can return fewer organizations than requested. If unspecified, + * server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A pagination token returned from a previous call to + * `SearchOrganizations` that indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to + * `SearchOrganizations` that indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.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. An optional query string used to filter the Organizations to + * return in the response. Query rules are case-insensitive. + * ``` + * | Field | Description | + * |------------------|--------------------------------------------| + * | directoryCustomerId, owner.directoryCustomerId | Filters by directory + * customer id. | + * | domain | Filters by domain. | + * ``` + * Organizations may be queried by `directoryCustomerId` or by + * `domain`, where the domain is a G Suite domain, for example: + * * Query `directorycustomerid:123456789` returns Organization + * resources with `owner.directory_customer_id` equal to `123456789`. + * * Query `domain:google.com` returns Organization resources corresponding + * to the domain `google.com`. + * + * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Optional. An optional query string used to filter the Organizations to + * return in the response. Query rules are case-insensitive. + * ``` + * | Field | Description | + * |------------------|--------------------------------------------| + * | directoryCustomerId, owner.directoryCustomerId | Filters by directory + * customer id. | + * | domain | Filters by domain. | + * ``` + * Organizations may be queried by `directoryCustomerId` or by + * `domain`, where the domain is a G Suite domain, for example: + * * Query `directorycustomerid:123456789` returns Organization + * resources with `owner.directory_customer_id` equal to `123456789`. + * * Query `domain:google.com` returns Organization resources corresponding + * to the domain `google.com`. + * + * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsResponse.php new file mode 100644 index 000000000000..74823ebb56d8 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsResponse.php @@ -0,0 +1,121 @@ +google.cloud.resourcemanager.v3.SearchOrganizationsResponse + */ +class SearchOrganizationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Organizations that matched the search query, possibly + * paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + private $organizations; + /** + * A pagination token to be used to retrieve the next page of results. If the + * result is too large to fit within the page size specified in the request, + * this field will be set with a token that can be used to fetch the next page + * of results. If this field is empty, it indicates that this response + * contains the last page of results. + * + * 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\ResourceManager\V3\Organization>|\Google\Protobuf\Internal\RepeatedField $organizations + * The list of Organizations that matched the search query, possibly + * paginated. + * @type string $next_page_token + * A pagination token to be used to retrieve the next page of results. If the + * result is too large to fit within the page size specified in the request, + * this field will be set with a token that can be used to fetch the next page + * of results. If this field is empty, it indicates that this response + * contains the last page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); + parent::__construct($data); + } + + /** + * The list of Organizations that matched the search query, possibly + * paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOrganizations() + { + return $this->organizations; + } + + /** + * The list of Organizations that matched the search query, possibly + * paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + * @param array<\Google\Cloud\ResourceManager\V3\Organization>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOrganizations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Organization::class); + $this->organizations = $arr; + + return $this; + } + + /** + * A pagination token to be used to retrieve the next page of results. If the + * result is too large to fit within the page size specified in the request, + * this field will be set with a token that can be used to fetch the next page + * of results. If this field is empty, it indicates that this response + * contains the last page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A pagination token to be used to retrieve the next page of results. If the + * result is too large to fit within the page size specified in the request, + * this field will be set with a token that can be used to fetch the next page + * of results. If this field is empty, it indicates that this response + * contains the last page of results. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsRequest.php new file mode 100644 index 000000000000..1194941630f0 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsRequest.php @@ -0,0 +1,257 @@ +google.cloud.resourcemanager.v3.SearchProjectsRequest + */ +class SearchProjectsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A query string for searching for projects that the caller has + * `resourcemanager.projects.get` permission to. If multiple fields are + * included in the query, then it will return results that match any of the + * fields. Some eligible fields are: + * - **`displayName`, `name`**: Filters by displayName. + * - **`parent`**: Project's parent (for example: `folders/123`, + * `organizations/*`). Prefer `parent` field over `parent.type` and + * `parent.id`. + * - **`parent.type`**: Parent's type: `folder` or `organization`. + * - **`parent.id`**: Parent's id number (for example: `123`). + * - **`id`, `projectId`**: Filters by projectId. + * - **`state`, `lifecycleState`**: Filters by state. + * - **`labels`**: Filters by label name or value. + * - **`labels.` (where `` is the name of a label)**: Filters by label + * name. + * Search expressions are case insensitive. + * Some examples queries: + * - **`name:how*`**: The project's name starts with "how". + * - **`name:Howl`**: The project's name is `Howl` or `howl`. + * - **`name:HOWL`**: Equivalent to above. + * - **`NAME:howl`**: Equivalent to above. + * - **`labels.color:*`**: The project has the label `color`. + * - **`labels.color:red`**: The project's label `color` has the value `red`. + * - **`labels.color:red labels.size:big`**: The project's label `color` has + * the value `red` or its label `size` has the value `big`. + * If no query is specified, the call will return projects for which the user + * has the `resourcemanager.projects.get` permission. + * + * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $query = ''; + /** + * Optional. A pagination token returned from a previous call to + * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + * indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query + * Optional. A query string for searching for projects that the caller has + * `resourcemanager.projects.get` permission to. If multiple fields are + * included in the query, then it will return results that match any of the + * fields. Some eligible fields are: + * - **`displayName`, `name`**: Filters by displayName. + * - **`parent`**: Project's parent (for example: `folders/123`, + * `organizations/*`). Prefer `parent` field over `parent.type` and + * `parent.id`. + * - **`parent.type`**: Parent's type: `folder` or `organization`. + * - **`parent.id`**: Parent's id number (for example: `123`). + * - **`id`, `projectId`**: Filters by projectId. + * - **`state`, `lifecycleState`**: Filters by state. + * - **`labels`**: Filters by label name or value. + * - **`labels.` (where `` is the name of a label)**: Filters by label + * name. + * Search expressions are case insensitive. + * Some examples queries: + * - **`name:how*`**: The project's name starts with "how". + * - **`name:Howl`**: The project's name is `Howl` or `howl`. + * - **`name:HOWL`**: Equivalent to above. + * - **`NAME:howl`**: Equivalent to above. + * - **`labels.color:*`**: The project has the label `color`. + * - **`labels.color:red`**: The project's label `color` has the value `red`. + * - **`labels.color:red labels.size:big`**: The project's label `color` has + * the value `red` or its label `size` has the value `big`. + * If no query is specified, the call will return projects for which the user + * has the `resourcemanager.projects.get` permission. + * @type string $page_token + * Optional. A pagination token returned from a previous call to + * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + * indicates from where listing should continue. + * @type int $page_size + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A query string for searching for projects that the caller has + * `resourcemanager.projects.get` permission to. If multiple fields are + * included in the query, then it will return results that match any of the + * fields. Some eligible fields are: + * - **`displayName`, `name`**: Filters by displayName. + * - **`parent`**: Project's parent (for example: `folders/123`, + * `organizations/*`). Prefer `parent` field over `parent.type` and + * `parent.id`. + * - **`parent.type`**: Parent's type: `folder` or `organization`. + * - **`parent.id`**: Parent's id number (for example: `123`). + * - **`id`, `projectId`**: Filters by projectId. + * - **`state`, `lifecycleState`**: Filters by state. + * - **`labels`**: Filters by label name or value. + * - **`labels.` (where `` is the name of a label)**: Filters by label + * name. + * Search expressions are case insensitive. + * Some examples queries: + * - **`name:how*`**: The project's name starts with "how". + * - **`name:Howl`**: The project's name is `Howl` or `howl`. + * - **`name:HOWL`**: Equivalent to above. + * - **`NAME:howl`**: Equivalent to above. + * - **`labels.color:*`**: The project has the label `color`. + * - **`labels.color:red`**: The project's label `color` has the value `red`. + * - **`labels.color:red labels.size:big`**: The project's label `color` has + * the value `red` or its label `size` has the value `big`. + * If no query is specified, the call will return projects for which the user + * has the `resourcemanager.projects.get` permission. + * + * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Optional. A query string for searching for projects that the caller has + * `resourcemanager.projects.get` permission to. If multiple fields are + * included in the query, then it will return results that match any of the + * fields. Some eligible fields are: + * - **`displayName`, `name`**: Filters by displayName. + * - **`parent`**: Project's parent (for example: `folders/123`, + * `organizations/*`). Prefer `parent` field over `parent.type` and + * `parent.id`. + * - **`parent.type`**: Parent's type: `folder` or `organization`. + * - **`parent.id`**: Parent's id number (for example: `123`). + * - **`id`, `projectId`**: Filters by projectId. + * - **`state`, `lifecycleState`**: Filters by state. + * - **`labels`**: Filters by label name or value. + * - **`labels.` (where `` is the name of a label)**: Filters by label + * name. + * Search expressions are case insensitive. + * Some examples queries: + * - **`name:how*`**: The project's name starts with "how". + * - **`name:Howl`**: The project's name is `Howl` or `howl`. + * - **`name:HOWL`**: Equivalent to above. + * - **`NAME:howl`**: Equivalent to above. + * - **`labels.color:*`**: The project has the label `color`. + * - **`labels.color:red`**: The project's label `color` has the value `red`. + * - **`labels.color:red labels.size:big`**: The project's label `color` has + * the value `red` or its label `size` has the value `big`. + * If no query is specified, the call will return projects for which the user + * has the `resourcemanager.projects.get` permission. + * + * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * Optional. A pagination token returned from a previous call to + * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + * indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A pagination token returned from a previous call to + * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + * indicates from where listing should continue. + * + * Generated from protobuf field string page_token = 2 [(.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 maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsResponse.php new file mode 100644 index 000000000000..3e3f0aaddf9a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsResponse.php @@ -0,0 +1,138 @@ +google.cloud.resourcemanager.v3.SearchProjectsResponse + */ +class SearchProjectsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Projects that matched the list filter query. This list can + * be paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + private $projects; + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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\ResourceManager\V3\Project>|\Google\Protobuf\Internal\RepeatedField $projects + * The list of Projects that matched the list filter query. This list can + * be paginated. + * @type string $next_page_token + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * The list of Projects that matched the list filter query. This list can + * be paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProjects() + { + return $this->projects; + } + + /** + * The list of Projects that matched the list filter query. This list can + * be paginated. + * + * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; + * @param array<\Google\Cloud\ResourceManager\V3\Project>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProjects($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Project::class); + $this->projects = $arr; + + return $this; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Pagination token. + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * Pagination tokens have a limited lifetime. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBinding.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBinding.php new file mode 100644 index 000000000000..217deee78cb4 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBinding.php @@ -0,0 +1,207 @@ +google.cloud.resourcemanager.v3.TagBinding + */ +class TagBinding extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the TagBinding. This is a String of the form: + * `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * The full resource name of the resource the TagValue is bound to. + * E.g. `//cloudresourcemanager.googleapis.com/projects/123` + * + * Generated from protobuf field string parent = 2; + */ + protected $parent = ''; + /** + * The TagValue of the TagBinding. + * Must be of the form `tagValues/456`. + * + * Generated from protobuf field string tag_value = 3; + */ + protected $tag_value = ''; + /** + * The namespaced name for the TagValue of the TagBinding. + * Must be in the format + * `{parent_id}/{tag_key_short_name}/{short_name}`. + * For methods that support TagValue namespaced name, only one of + * tag_value_namespaced_name or tag_value may be filled. Requests with both + * fields will be rejected. + * + * Generated from protobuf field string tag_value_namespaced_name = 4; + */ + protected $tag_value_namespaced_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The name of the TagBinding. This is a String of the form: + * `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * @type string $parent + * The full resource name of the resource the TagValue is bound to. + * E.g. `//cloudresourcemanager.googleapis.com/projects/123` + * @type string $tag_value + * The TagValue of the TagBinding. + * Must be of the form `tagValues/456`. + * @type string $tag_value_namespaced_name + * The namespaced name for the TagValue of the TagBinding. + * Must be in the format + * `{parent_id}/{tag_key_short_name}/{short_name}`. + * For methods that support TagValue namespaced name, only one of + * tag_value_namespaced_name or tag_value may be filled. Requests with both + * fields will be rejected. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the TagBinding. This is a String of the form: + * `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of the TagBinding. This is a String of the form: + * `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The full resource name of the resource the TagValue is bound to. + * E.g. `//cloudresourcemanager.googleapis.com/projects/123` + * + * Generated from protobuf field string parent = 2; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * The full resource name of the resource the TagValue is bound to. + * E.g. `//cloudresourcemanager.googleapis.com/projects/123` + * + * Generated from protobuf field string parent = 2; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The TagValue of the TagBinding. + * Must be of the form `tagValues/456`. + * + * Generated from protobuf field string tag_value = 3; + * @return string + */ + public function getTagValue() + { + return $this->tag_value; + } + + /** + * The TagValue of the TagBinding. + * Must be of the form `tagValues/456`. + * + * Generated from protobuf field string tag_value = 3; + * @param string $var + * @return $this + */ + public function setTagValue($var) + { + GPBUtil::checkString($var, True); + $this->tag_value = $var; + + return $this; + } + + /** + * The namespaced name for the TagValue of the TagBinding. + * Must be in the format + * `{parent_id}/{tag_key_short_name}/{short_name}`. + * For methods that support TagValue namespaced name, only one of + * tag_value_namespaced_name or tag_value may be filled. Requests with both + * fields will be rejected. + * + * Generated from protobuf field string tag_value_namespaced_name = 4; + * @return string + */ + public function getTagValueNamespacedName() + { + return $this->tag_value_namespaced_name; + } + + /** + * The namespaced name for the TagValue of the TagBinding. + * Must be in the format + * `{parent_id}/{tag_key_short_name}/{short_name}`. + * For methods that support TagValue namespaced name, only one of + * tag_value_namespaced_name or tag_value may be filled. Requests with both + * fields will be rejected. + * + * Generated from protobuf field string tag_value_namespaced_name = 4; + * @param string $var + * @return $this + */ + public function setTagValueNamespacedName($var) + { + GPBUtil::checkString($var, True); + $this->tag_value_namespaced_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBindingsGrpcClient.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBindingsGrpcClient.php new file mode 100644 index 000000000000..ab94e4e1c165 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBindingsGrpcClient.php @@ -0,0 +1,101 @@ +_simpleRequest('/google.cloud.resourcemanager.v3.TagBindings/ListTagBindings', + $argument, + ['\Google\Cloud\ResourceManager\V3\ListTagBindingsResponse', 'decode'], + $metadata, $options); + } + + /** + * Creates a TagBinding between a TagValue and a Google Cloud resource. + * @param \Google\Cloud\ResourceManager\V3\CreateTagBindingRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateTagBinding(\Google\Cloud\ResourceManager\V3\CreateTagBindingRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagBindings/CreateTagBinding', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Deletes a TagBinding. + * @param \Google\Cloud\ResourceManager\V3\DeleteTagBindingRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteTagBinding(\Google\Cloud\ResourceManager\V3\DeleteTagBindingRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagBindings/DeleteTagBinding', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Return a list of effective tags for the given Google Cloud resource, as + * specified in `parent`. + * @param \Google\Cloud\ResourceManager\V3\ListEffectiveTagsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListEffectiveTags(\Google\Cloud\ResourceManager\V3\ListEffectiveTagsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagBindings/ListEffectiveTags', + $argument, + ['\Google\Cloud\ResourceManager\V3\ListEffectiveTagsResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHold.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHold.php new file mode 100644 index 000000000000..7e2ee136616a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHold.php @@ -0,0 +1,256 @@ +google.cloud.resourcemanager.v3.TagHold + */ +class TagHold extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of a TagHold. This is a String of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` + * (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by + * the server. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. The name of the resource where the TagValue is being used. Must + * be less than 200 characters. E.g. + * `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + * + * Generated from protobuf field string holder = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $holder = ''; + /** + * Optional. An optional string representing the origin of this request. This + * field should include human-understandable information to distinguish + * origins from each other. Must be less than 200 characters. E.g. + * `migs-35678234` + * + * Generated from protobuf field string origin = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $origin = ''; + /** + * Optional. A URL where an end user can learn more about removing this hold. + * E.g. + * `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` + * + * Generated from protobuf field string help_link = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $help_link = ''; + /** + * Output only. The time this TagHold was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of a TagHold. This is a String of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` + * (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by + * the server. + * @type string $holder + * Required. The name of the resource where the TagValue is being used. Must + * be less than 200 characters. E.g. + * `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + * @type string $origin + * Optional. An optional string representing the origin of this request. This + * field should include human-understandable information to distinguish + * origins from each other. Must be less than 200 characters. E.g. + * `migs-35678234` + * @type string $help_link + * Optional. A URL where an end user can learn more about removing this hold. + * E.g. + * `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time this TagHold was created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of a TagHold. This is a String of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` + * (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by + * the server. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of a TagHold. This is a String of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` + * (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by + * the server. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The name of the resource where the TagValue is being used. Must + * be less than 200 characters. E.g. + * `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + * + * Generated from protobuf field string holder = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHolder() + { + return $this->holder; + } + + /** + * Required. The name of the resource where the TagValue is being used. Must + * be less than 200 characters. E.g. + * `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + * + * Generated from protobuf field string holder = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHolder($var) + { + GPBUtil::checkString($var, True); + $this->holder = $var; + + return $this; + } + + /** + * Optional. An optional string representing the origin of this request. This + * field should include human-understandable information to distinguish + * origins from each other. Must be less than 200 characters. E.g. + * `migs-35678234` + * + * Generated from protobuf field string origin = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrigin() + { + return $this->origin; + } + + /** + * Optional. An optional string representing the origin of this request. This + * field should include human-understandable information to distinguish + * origins from each other. Must be less than 200 characters. E.g. + * `migs-35678234` + * + * Generated from protobuf field string origin = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrigin($var) + { + GPBUtil::checkString($var, True); + $this->origin = $var; + + return $this; + } + + /** + * Optional. A URL where an end user can learn more about removing this hold. + * E.g. + * `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` + * + * Generated from protobuf field string help_link = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getHelpLink() + { + return $this->help_link; + } + + /** + * Optional. A URL where an end user can learn more about removing this hold. + * E.g. + * `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` + * + * Generated from protobuf field string help_link = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setHelpLink($var) + { + GPBUtil::checkString($var, True); + $this->help_link = $var; + + return $this; + } + + /** + * Output only. The time this TagHold was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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 time this TagHold was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHoldsGrpcClient.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHoldsGrpcClient.php new file mode 100644 index 000000000000..83919d8d33a9 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHoldsGrpcClient.php @@ -0,0 +1,85 @@ +_simpleRequest('/google.cloud.resourcemanager.v3.TagHolds/CreateTagHold', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Deletes a TagHold. + * @param \Google\Cloud\ResourceManager\V3\DeleteTagHoldRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteTagHold(\Google\Cloud\ResourceManager\V3\DeleteTagHoldRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagHolds/DeleteTagHold', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Lists TagHolds under a TagValue. + * @param \Google\Cloud\ResourceManager\V3\ListTagHoldsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListTagHolds(\Google\Cloud\ResourceManager\V3\ListTagHoldsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagHolds/ListTagHolds', + $argument, + ['\Google\Cloud\ResourceManager\V3\ListTagHoldsResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKey.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKey.php new file mode 100644 index 000000000000..a329b18ef1d3 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKey.php @@ -0,0 +1,477 @@ +google.cloud.resourcemanager.v3.TagKey + */ +class TagKey extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The resource name for a TagKey. Must be in the format + * `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for + * the TagKey. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Immutable. The resource name of the TagKey's parent. A TagKey can be + * parented by an Organization or a Project. For a TagKey parented by an + * Organization, its parent must be in the form `organizations/{org_id}`. For + * a TagKey parented by a Project, its parent can be in the form + * `projects/{project_id}` or `projects/{project_number}`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $parent = ''; + /** + * Required. Immutable. The user friendly name for a TagKey. The short name + * should be unique for TagKeys within the same tag namespace. + * The short name must be 1-63 characters, beginning and ending with + * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + * dots (.), and alphanumerics between. + * + * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $short_name = ''; + /** + * Output only. Immutable. Namespaced name of the TagKey. + * + * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $namespaced_name = ''; + /** + * Optional. User-assigned description of the TagKey. Must not exceed 256 + * characters. + * Read-write. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. Creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Entity tag which users can pass to prevent race conditions. This + * field is always set in server responses. See UpdateTagKeyRequest for + * details. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Optional. A purpose denotes that this Tag is intended for use in policies + * of a specific policy engine, and will involve that policy engine in + * management operations involving this Tag. A purpose does not grant a + * policy engine exclusive rights to the Tag, and it may be referenced by + * other policy engines. + * A purpose cannot be changed once set. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Purpose purpose = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $purpose = 0; + /** + * Optional. Purpose data corresponds to the policy system that the tag is + * intended for. See documentation for `Purpose` for formatting of this field. + * Purpose data cannot be changed once set. + * + * Generated from protobuf field map purpose_data = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $purpose_data; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. The resource name for a TagKey. Must be in the format + * `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for + * the TagKey. + * @type string $parent + * Immutable. The resource name of the TagKey's parent. A TagKey can be + * parented by an Organization or a Project. For a TagKey parented by an + * Organization, its parent must be in the form `organizations/{org_id}`. For + * a TagKey parented by a Project, its parent can be in the form + * `projects/{project_id}` or `projects/{project_number}`. + * @type string $short_name + * Required. Immutable. The user friendly name for a TagKey. The short name + * should be unique for TagKeys within the same tag namespace. + * The short name must be 1-63 characters, beginning and ending with + * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + * dots (.), and alphanumerics between. + * @type string $namespaced_name + * Output only. Immutable. Namespaced name of the TagKey. + * @type string $description + * Optional. User-assigned description of the TagKey. Must not exceed 256 + * characters. + * Read-write. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time. + * @type string $etag + * Optional. Entity tag which users can pass to prevent race conditions. This + * field is always set in server responses. See UpdateTagKeyRequest for + * details. + * @type int $purpose + * Optional. A purpose denotes that this Tag is intended for use in policies + * of a specific policy engine, and will involve that policy engine in + * management operations involving this Tag. A purpose does not grant a + * policy engine exclusive rights to the Tag, and it may be referenced by + * other policy engines. + * A purpose cannot be changed once set. + * @type array|\Google\Protobuf\Internal\MapField $purpose_data + * Optional. Purpose data corresponds to the policy system that the tag is + * intended for. See documentation for `Purpose` for formatting of this field. + * Purpose data cannot be changed once set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The resource name for a TagKey. Must be in the format + * `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for + * the TagKey. + * + * 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 a TagKey. Must be in the format + * `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for + * the TagKey. + * + * 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; + } + + /** + * Immutable. The resource name of the TagKey's parent. A TagKey can be + * parented by an Organization or a Project. For a TagKey parented by an + * Organization, its parent must be in the form `organizations/{org_id}`. For + * a TagKey parented by a Project, its parent can be in the form + * `projects/{project_id}` or `projects/{project_number}`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Immutable. The resource name of the TagKey's parent. A TagKey can be + * parented by an Organization or a Project. For a TagKey parented by an + * Organization, its parent must be in the form `organizations/{org_id}`. For + * a TagKey parented by a Project, its parent can be in the form + * `projects/{project_id}` or `projects/{project_number}`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Immutable. The user friendly name for a TagKey. The short name + * should be unique for TagKeys within the same tag namespace. + * The short name must be 1-63 characters, beginning and ending with + * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + * dots (.), and alphanumerics between. + * + * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getShortName() + { + return $this->short_name; + } + + /** + * Required. Immutable. The user friendly name for a TagKey. The short name + * should be unique for TagKeys within the same tag namespace. + * The short name must be 1-63 characters, beginning and ending with + * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + * dots (.), and alphanumerics between. + * + * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setShortName($var) + { + GPBUtil::checkString($var, True); + $this->short_name = $var; + + return $this; + } + + /** + * Output only. Immutable. Namespaced name of the TagKey. + * + * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getNamespacedName() + { + return $this->namespaced_name; + } + + /** + * Output only. Immutable. Namespaced name of the TagKey. + * + * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setNamespacedName($var) + { + GPBUtil::checkString($var, True); + $this->namespaced_name = $var; + + return $this; + } + + /** + * Optional. User-assigned description of the TagKey. Must not exceed 256 + * characters. + * Read-write. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. User-assigned description of the TagKey. Must not exceed 256 + * characters. + * Read-write. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. Creation time. + * + * 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. Creation time. + * + * 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. Update time. + * + * 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. Update time. + * + * 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; + } + + /** + * Optional. Entity tag which users can pass to prevent race conditions. This + * field is always set in server responses. See UpdateTagKeyRequest for + * details. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. Entity tag which users can pass to prevent race conditions. This + * field is always set in server responses. See UpdateTagKeyRequest for + * details. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. A purpose denotes that this Tag is intended for use in policies + * of a specific policy engine, and will involve that policy engine in + * management operations involving this Tag. A purpose does not grant a + * policy engine exclusive rights to the Tag, and it may be referenced by + * other policy engines. + * A purpose cannot be changed once set. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Purpose purpose = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPurpose() + { + return $this->purpose; + } + + /** + * Optional. A purpose denotes that this Tag is intended for use in policies + * of a specific policy engine, and will involve that policy engine in + * management operations involving this Tag. A purpose does not grant a + * policy engine exclusive rights to the Tag, and it may be referenced by + * other policy engines. + * A purpose cannot be changed once set. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Purpose purpose = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPurpose($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V3\Purpose::class); + $this->purpose = $var; + + return $this; + } + + /** + * Optional. Purpose data corresponds to the policy system that the tag is + * intended for. See documentation for `Purpose` for formatting of this field. + * Purpose data cannot be changed once set. + * + * Generated from protobuf field map purpose_data = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getPurposeData() + { + return $this->purpose_data; + } + + /** + * Optional. Purpose data corresponds to the policy system that the tag is + * intended for. See documentation for `Purpose` for formatting of this field. + * Purpose data cannot be changed once set. + * + * Generated from protobuf field map purpose_data = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setPurposeData($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->purpose_data = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKeysGrpcClient.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKeysGrpcClient.php new file mode 100644 index 000000000000..1c849871b158 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKeysGrpcClient.php @@ -0,0 +1,190 @@ +_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/ListTagKeys', + $argument, + ['\Google\Cloud\ResourceManager\V3\ListTagKeysResponse', 'decode'], + $metadata, $options); + } + + /** + * Retrieves a TagKey. This method will return `PERMISSION_DENIED` if the + * key does not exist or the user does not have permission to view it. + * @param \Google\Cloud\ResourceManager\V3\GetTagKeyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetTagKey(\Google\Cloud\ResourceManager\V3\GetTagKeyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/GetTagKey', + $argument, + ['\Google\Cloud\ResourceManager\V3\TagKey', 'decode'], + $metadata, $options); + } + + /** + * Retrieves a TagKey by its namespaced name. + * This method will return `PERMISSION_DENIED` if the key does not exist + * or the user does not have permission to view it. + * @param \Google\Cloud\ResourceManager\V3\GetNamespacedTagKeyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetNamespacedTagKey(\Google\Cloud\ResourceManager\V3\GetNamespacedTagKeyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/GetNamespacedTagKey', + $argument, + ['\Google\Cloud\ResourceManager\V3\TagKey', 'decode'], + $metadata, $options); + } + + /** + * Creates a new TagKey. If another request with the same parameters is + * sent while the original request is in process, the second request + * will receive an error. A maximum of 1000 TagKeys can exist under a parent + * at any given time. + * @param \Google\Cloud\ResourceManager\V3\CreateTagKeyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateTagKey(\Google\Cloud\ResourceManager\V3\CreateTagKeyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/CreateTagKey', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Updates the attributes of the TagKey resource. + * @param \Google\Cloud\ResourceManager\V3\UpdateTagKeyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateTagKey(\Google\Cloud\ResourceManager\V3\UpdateTagKeyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/UpdateTagKey', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Deletes a TagKey. The TagKey cannot be deleted if it has any child + * TagValues. + * @param \Google\Cloud\ResourceManager\V3\DeleteTagKeyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteTagKey(\Google\Cloud\ResourceManager\V3\DeleteTagKeyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/DeleteTagKey', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Gets the access control policy for a TagKey. The returned policy may be + * empty if no such policy or resource exists. The `resource` field should + * be the TagKey's resource name. For example, "tagKeys/1234". + * The caller must have + * `cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy` permission on + * the specified TagKey. + * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/GetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * Sets the access control policy on a TagKey, replacing any existing + * policy. The `resource` field should be the TagKey's resource name. + * For example, "tagKeys/1234". + * The caller must have `resourcemanager.tagKeys.setIamPolicy` permission + * on the identified tagValue. + * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/SetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * Returns permissions that a caller has on the specified TagKey. + * The `resource` field should be the TagKey's resource name. + * For example, "tagKeys/1234". + * + * There are no permissions required for making this API call. + * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/TestIamPermissions', + $argument, + ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValue.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValue.php new file mode 100644 index 000000000000..6a2d8efaf8b1 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValue.php @@ -0,0 +1,374 @@ +google.cloud.resourcemanager.v3.TagValue + */ +class TagValue extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. Resource name for TagValue in the format `tagValues/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Immutable. The resource name of the new TagValue's parent TagKey. + * Must be of the form `tagKeys/{tag_key_id}`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $parent = ''; + /** + * Required. Immutable. User-assigned short name for TagValue. The short name + * should be unique for TagValues within the same parent TagKey. + * The short name must be 63 characters or less, beginning and ending with + * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + * dots (.), and alphanumerics between. + * + * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $short_name = ''; + /** + * Output only. The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * + * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $namespaced_name = ''; + /** + * Optional. User-assigned description of the TagValue. + * Must not exceed 256 characters. + * Read-write. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. Creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Entity tag which users can pass to prevent race conditions. This + * field is always set in server responses. See UpdateTagValueRequest for + * details. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. Resource name for TagValue in the format `tagValues/456`. + * @type string $parent + * Immutable. The resource name of the new TagValue's parent TagKey. + * Must be of the form `tagKeys/{tag_key_id}`. + * @type string $short_name + * Required. Immutable. User-assigned short name for TagValue. The short name + * should be unique for TagValues within the same parent TagKey. + * The short name must be 63 characters or less, beginning and ending with + * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + * dots (.), and alphanumerics between. + * @type string $namespaced_name + * Output only. The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * @type string $description + * Optional. User-assigned description of the TagValue. + * Must not exceed 256 characters. + * Read-write. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time. + * @type string $etag + * Optional. Entity tag which users can pass to prevent race conditions. This + * field is always set in server responses. See UpdateTagValueRequest for + * details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. Resource name for TagValue in the format `tagValues/456`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. Resource name for TagValue in the format `tagValues/456`. + * + * 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; + } + + /** + * Immutable. The resource name of the new TagValue's parent TagKey. + * Must be of the form `tagKeys/{tag_key_id}`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Immutable. The resource name of the new TagValue's parent TagKey. + * Must be of the form `tagKeys/{tag_key_id}`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Immutable. User-assigned short name for TagValue. The short name + * should be unique for TagValues within the same parent TagKey. + * The short name must be 63 characters or less, beginning and ending with + * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + * dots (.), and alphanumerics between. + * + * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getShortName() + { + return $this->short_name; + } + + /** + * Required. Immutable. User-assigned short name for TagValue. The short name + * should be unique for TagValues within the same parent TagKey. + * The short name must be 63 characters or less, beginning and ending with + * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + * dots (.), and alphanumerics between. + * + * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setShortName($var) + { + GPBUtil::checkString($var, True); + $this->short_name = $var; + + return $this; + } + + /** + * Output only. The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * + * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNamespacedName() + { + return $this->namespaced_name; + } + + /** + * Output only. The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + * + * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNamespacedName($var) + { + GPBUtil::checkString($var, True); + $this->namespaced_name = $var; + + return $this; + } + + /** + * Optional. User-assigned description of the TagValue. + * Must not exceed 256 characters. + * Read-write. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. User-assigned description of the TagValue. + * Must not exceed 256 characters. + * Read-write. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. Creation time. + * + * 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. Creation time. + * + * 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. Update time. + * + * 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. Update time. + * + * 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; + } + + /** + * Optional. Entity tag which users can pass to prevent race conditions. This + * field is always set in server responses. See UpdateTagValueRequest for + * details. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. Entity tag which users can pass to prevent race conditions. This + * field is always set in server responses. See UpdateTagValueRequest for + * details. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValuesGrpcClient.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValuesGrpcClient.php new file mode 100644 index 000000000000..69083414977d --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValuesGrpcClient.php @@ -0,0 +1,190 @@ +_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/ListTagValues', + $argument, + ['\Google\Cloud\ResourceManager\V3\ListTagValuesResponse', 'decode'], + $metadata, $options); + } + + /** + * Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the + * value does not exist or the user does not have permission to view it. + * @param \Google\Cloud\ResourceManager\V3\GetTagValueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetTagValue(\Google\Cloud\ResourceManager\V3\GetTagValueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/GetTagValue', + $argument, + ['\Google\Cloud\ResourceManager\V3\TagValue', 'decode'], + $metadata, $options); + } + + /** + * Retrieves a TagValue by its namespaced name. + * This method will return `PERMISSION_DENIED` if the value does not exist + * or the user does not have permission to view it. + * @param \Google\Cloud\ResourceManager\V3\GetNamespacedTagValueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetNamespacedTagValue(\Google\Cloud\ResourceManager\V3\GetNamespacedTagValueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/GetNamespacedTagValue', + $argument, + ['\Google\Cloud\ResourceManager\V3\TagValue', 'decode'], + $metadata, $options); + } + + /** + * Creates a TagValue as a child of the specified TagKey. If a another + * request with the same parameters is sent while the original request is in + * process the second request will receive an error. A maximum of 1000 + * TagValues can exist under a TagKey at any given time. + * @param \Google\Cloud\ResourceManager\V3\CreateTagValueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateTagValue(\Google\Cloud\ResourceManager\V3\CreateTagValueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/CreateTagValue', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Updates the attributes of the TagValue resource. + * @param \Google\Cloud\ResourceManager\V3\UpdateTagValueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateTagValue(\Google\Cloud\ResourceManager\V3\UpdateTagValueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/UpdateTagValue', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Deletes a TagValue. The TagValue cannot have any bindings when it is + * deleted. + * @param \Google\Cloud\ResourceManager\V3\DeleteTagValueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteTagValue(\Google\Cloud\ResourceManager\V3\DeleteTagValueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/DeleteTagValue', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Gets the access control policy for a TagValue. The returned policy may be + * empty if no such policy or resource exists. The `resource` field should + * be the TagValue's resource name. For example: `tagValues/1234`. + * The caller must have the + * `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on + * the identified TagValue to get the access control policy. + * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/GetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * Sets the access control policy on a TagValue, replacing any existing + * policy. The `resource` field should be the TagValue's resource name. + * For example: `tagValues/1234`. + * The caller must have `resourcemanager.tagValues.setIamPolicy` permission + * on the identified tagValue. + * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/SetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * Returns permissions that a caller has on the specified TagValue. + * The `resource` field should be the TagValue's resource name. For example: + * `tagValues/1234`. + * + * There are no permissions required for making this API call. + * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/TestIamPermissions', + $argument, + ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderMetadata.php new file mode 100644 index 000000000000..25c40d3462a8 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.UndeleteFolderMetadata + */ +class UndeleteFolderMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderRequest.php new file mode 100644 index 000000000000..b1addef0c746 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderRequest.php @@ -0,0 +1,71 @@ +google.cloud.resourcemanager.v3.UndeleteFolderRequest + */ +class UndeleteFolderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the folder to undelete. + * Must be of the form `folders/{folder_id}`. + * + * 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 resource name of the folder to undelete. + * Must be of the form `folders/{folder_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the folder to undelete. + * Must be of the form `folders/{folder_id}`. + * + * 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 resource name of the folder to undelete. + * Must be of the form `folders/{folder_id}`. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteOrganizationMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteOrganizationMetadata.php new file mode 100644 index 000000000000..4652f9473a93 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteOrganizationMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata + */ +class UndeleteOrganizationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectMetadata.php new file mode 100644 index 000000000000..2dcdba313d18 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.UndeleteProjectMetadata + */ +class UndeleteProjectMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectRequest.php new file mode 100644 index 000000000000..fbaf24001b78 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectRequest.php @@ -0,0 +1,73 @@ +google.cloud.resourcemanager.v3.UndeleteProjectRequest + */ +class UndeleteProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project (for example, `projects/415104041262`). + * Required. + * + * 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 project (for example, `projects/415104041262`). + * Required. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project (for example, `projects/415104041262`). + * Required. + * + * 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 project (for example, `projects/415104041262`). + * Required. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderMetadata.php new file mode 100644 index 000000000000..4048d4d5bc33 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.UpdateFolderMetadata + */ +class UpdateFolderMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderRequest.php new file mode 100644 index 000000000000..ad7af259e5bc --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderRequest.php @@ -0,0 +1,135 @@ +google.cloud.resourcemanager.v3.UpdateFolderRequest + */ +class UpdateFolderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new definition of the Folder. It must include the `name` + * field, which cannot be changed. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $folder = null; + /** + * Required. Fields to be updated. + * Only the `display_name` can be updated. + * + * 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\ResourceManager\V3\Folder $folder + * Required. The new definition of the Folder. It must include the `name` + * field, which cannot be changed. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Fields to be updated. + * Only the `display_name` can be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new definition of the Folder. It must include the `name` + * field, which cannot be changed. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\Folder|null + */ + public function getFolder() + { + return $this->folder; + } + + public function hasFolder() + { + return isset($this->folder); + } + + public function clearFolder() + { + unset($this->folder); + } + + /** + * Required. The new definition of the Folder. It must include the `name` + * field, which cannot be changed. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\Folder $var + * @return $this + */ + public function setFolder($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\Folder::class); + $this->folder = $var; + + return $this; + } + + /** + * Required. Fields to be updated. + * Only the `display_name` can be updated. + * + * 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. Fields to be updated. + * Only the `display_name` can be updated. + * + * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectMetadata.php new file mode 100644 index 000000000000..9f46eb9a63c1 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectMetadata.php @@ -0,0 +1,34 @@ +google.cloud.resourcemanager.v3.UpdateProjectMetadata + */ +class UpdateProjectMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectRequest.php new file mode 100644 index 000000000000..46b58d100ac5 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectRequest.php @@ -0,0 +1,126 @@ +google.cloud.resourcemanager.v3.UpdateProjectRequest + */ +class UpdateProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new definition of the project. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = null; + /** + * Optional. An update mask to selectively update fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceManager\V3\Project $project + * Required. The new definition of the project. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. An update mask to selectively update fields. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new definition of the project. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\Project|null + */ + public function getProject() + { + return $this->project; + } + + public function hasProject() + { + return isset($this->project); + } + + public function clearProject() + { + unset($this->project); + } + + /** + * Required. The new definition of the project. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\Project $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\Project::class); + $this->project = $var; + + return $this; + } + + /** + * Optional. An update mask to selectively update fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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); + } + + /** + * Optional. An update mask to selectively update fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyMetadata.php new file mode 100644 index 000000000000..deef54c740c6 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyMetadata.php @@ -0,0 +1,33 @@ +google.cloud.resourcemanager.v3.UpdateTagKeyMetadata + */ +class UpdateTagKeyMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyRequest.php new file mode 100644 index 000000000000..f6040aad1a0e --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyRequest.php @@ -0,0 +1,179 @@ +google.cloud.resourcemanager.v3.UpdateTagKeyRequest + */ +class UpdateTagKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new definition of the TagKey. Only the `description` and + * `etag` fields can be updated by this request. If the `etag` field is not + * empty, it must match the `etag` field of the existing tag key. Otherwise, + * `ABORTED` will be returned. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tag_key = null; + /** + * Fields to be updated. The mask may only contain `description` or + * `etag`. If omitted entirely, both `description` and `etag` are assumed to + * be significant. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + /** + * Set as true to perform validations necessary for updating the resource, but + * not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceManager\V3\TagKey $tag_key + * Required. The new definition of the TagKey. Only the `description` and + * `etag` fields can be updated by this request. If the `etag` field is not + * empty, it must match the `etag` field of the existing tag key. Otherwise, + * `ABORTED` will be returned. + * @type \Google\Protobuf\FieldMask $update_mask + * Fields to be updated. The mask may only contain `description` or + * `etag`. If omitted entirely, both `description` and `etag` are assumed to + * be significant. + * @type bool $validate_only + * Set as true to perform validations necessary for updating the resource, but + * not actually perform the action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new definition of the TagKey. Only the `description` and + * `etag` fields can be updated by this request. If the `etag` field is not + * empty, it must match the `etag` field of the existing tag key. Otherwise, + * `ABORTED` will be returned. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\TagKey|null + */ + public function getTagKey() + { + return $this->tag_key; + } + + public function hasTagKey() + { + return isset($this->tag_key); + } + + public function clearTagKey() + { + unset($this->tag_key); + } + + /** + * Required. The new definition of the TagKey. Only the `description` and + * `etag` fields can be updated by this request. If the `etag` field is not + * empty, it must match the `etag` field of the existing tag key. Otherwise, + * `ABORTED` will be returned. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\TagKey $var + * @return $this + */ + public function setTagKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagKey::class); + $this->tag_key = $var; + + return $this; + } + + /** + * Fields to be updated. The mask may only contain `description` or + * `etag`. If omitted entirely, both `description` and `etag` are assumed to + * be significant. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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); + } + + /** + * Fields to be updated. The mask may only contain `description` or + * `etag`. If omitted entirely, both `description` and `etag` are assumed to + * be significant. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Set as true to perform validations necessary for updating the resource, but + * not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Set as true to perform validations necessary for updating the resource, but + * not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueMetadata.php new file mode 100644 index 000000000000..2503e836508e --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueMetadata.php @@ -0,0 +1,33 @@ +google.cloud.resourcemanager.v3.UpdateTagValueMetadata + */ +class UpdateTagValueMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueRequest.php new file mode 100644 index 000000000000..6c560b1ef835 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueRequest.php @@ -0,0 +1,171 @@ +google.cloud.resourcemanager.v3.UpdateTagValueRequest + */ +class UpdateTagValueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new definition of the TagValue. Only fields `description` and + * `etag` fields can be updated by this request. If the `etag` field is + * nonempty, it must match the `etag` field of the existing ControlGroup. + * Otherwise, `ABORTED` will be returned. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tag_value = null; + /** + * Optional. Fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Optional. True to perform validations necessary for updating the resource, + * but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ResourceManager\V3\TagValue $tag_value + * Required. The new definition of the TagValue. Only fields `description` and + * `etag` fields can be updated by this request. If the `etag` field is + * nonempty, it must match the `etag` field of the existing ControlGroup. + * Otherwise, `ABORTED` will be returned. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Fields to be updated. + * @type bool $validate_only + * Optional. True to perform validations necessary for updating the resource, + * but not actually perform the action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new definition of the TagValue. Only fields `description` and + * `etag` fields can be updated by this request. If the `etag` field is + * nonempty, it must match the `etag` field of the existing ControlGroup. + * Otherwise, `ABORTED` will be returned. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ResourceManager\V3\TagValue|null + */ + public function getTagValue() + { + return $this->tag_value; + } + + public function hasTagValue() + { + return isset($this->tag_value); + } + + public function clearTagValue() + { + unset($this->tag_value); + } + + /** + * Required. The new definition of the TagValue. Only fields `description` and + * `etag` fields can be updated by this request. If the `etag` field is + * nonempty, it must match the `etag` field of the existing ControlGroup. + * Otherwise, `ABORTED` will be returned. + * + * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ResourceManager\V3\TagValue $var + * @return $this + */ + public function setTagValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagValue::class); + $this->tag_value = $var; + + return $this; + } + + /** + * Optional. Fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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); + } + + /** + * Optional. Fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Optional. True to perform validations necessary for updating the resource, + * but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. True to perform validations necessary for updating the resource, + * but not actually perform the action. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/create_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/create_folder.php new file mode 100644 index 000000000000..9a3e8f006090 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/create_folder.php @@ -0,0 +1,109 @@ +setParent($folderParent); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $foldersClient->createFolder($folder); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Folder $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $folderParent = '[PARENT]'; + + create_folder_sample($folderParent); +} +// [END cloudresourcemanager_v3_generated_Folders_CreateFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/delete_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/delete_folder.php new file mode 100644 index 000000000000..1b39b9463289 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/delete_folder.php @@ -0,0 +1,89 @@ +deleteFolder($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Folder $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = FoldersClient::folderName('[FOLDER]'); + + delete_folder_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_Folders_DeleteFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_folder.php new file mode 100644 index 000000000000..c991c2fc1439 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_folder.php @@ -0,0 +1,71 @@ +getFolder($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 = FoldersClient::folderName('[FOLDER]'); + + get_folder_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_Folders_GetFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_iam_policy.php new file mode 100644 index 000000000000..72cd57a22f9f --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_iam_policy.php @@ -0,0 +1,70 @@ +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 cloudresourcemanager_v3_generated_Folders_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/list_folders.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/list_folders.php new file mode 100644 index 000000000000..89bd5e38adfa --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/list_folders.php @@ -0,0 +1,84 @@ +listFolders($parent); + + /** @var Folder $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 +{ + $parent = '[PARENT]'; + + list_folders_sample($parent); +} +// [END cloudresourcemanager_v3_generated_Folders_ListFolders_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/move_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/move_folder.php new file mode 100644 index 000000000000..44359a272874 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/move_folder.php @@ -0,0 +1,99 @@ +moveFolder($formattedName, $destinationParent); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Folder $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = FoldersClient::folderName('[FOLDER]'); + $destinationParent = '[DESTINATION_PARENT]'; + + move_folder_sample($formattedName, $destinationParent); +} +// [END cloudresourcemanager_v3_generated_Folders_MoveFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/search_folders.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/search_folders.php new file mode 100644 index 000000000000..174625e2ec30 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/search_folders.php @@ -0,0 +1,63 @@ +searchFolders(); + + /** @var Folder $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 cloudresourcemanager_v3_generated_Folders_SearchFolders_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/set_iam_policy.php new file mode 100644 index 000000000000..5ad2435cab46 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/set_iam_policy.php @@ -0,0 +1,73 @@ +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 cloudresourcemanager_v3_generated_Folders_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/test_iam_permissions.php new file mode 100644 index 000000000000..df182ebec87d --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +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 cloudresourcemanager_v3_generated_Folders_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/undelete_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/undelete_folder.php new file mode 100644 index 000000000000..66c2dce203e1 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/undelete_folder.php @@ -0,0 +1,89 @@ +undeleteFolder($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Folder $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = FoldersClient::folderName('[FOLDER]'); + + undelete_folder_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_Folders_UndeleteFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/update_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/update_folder.php new file mode 100644 index 000000000000..459a2a8d0055 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/update_folder.php @@ -0,0 +1,101 @@ +setParent($folderParent); + $updateMask = new FieldMask(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $foldersClient->updateFolder($folder, $updateMask); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Folder $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $folderParent = '[PARENT]'; + + update_folder_sample($folderParent); +} +// [END cloudresourcemanager_v3_generated_Folders_UpdateFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_iam_policy.php new file mode 100644 index 000000000000..fc7dcaa738d9 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_iam_policy.php @@ -0,0 +1,71 @@ +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 cloudresourcemanager_v3_generated_Organizations_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_organization.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_organization.php new file mode 100644 index 000000000000..0de781575fb9 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_organization.php @@ -0,0 +1,68 @@ +getOrganization($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 = OrganizationsClient::organizationName('[ORGANIZATION]'); + + get_organization_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_Organizations_GetOrganization_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/search_organizations.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/search_organizations.php new file mode 100644 index 000000000000..c496c70f2514 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/search_organizations.php @@ -0,0 +1,64 @@ +searchOrganizations(); + + /** @var Organization $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 cloudresourcemanager_v3_generated_Organizations_SearchOrganizations_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/set_iam_policy.php new file mode 100644 index 000000000000..57ebc77a4f74 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/set_iam_policy.php @@ -0,0 +1,74 @@ +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 cloudresourcemanager_v3_generated_Organizations_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/test_iam_permissions.php new file mode 100644 index 000000000000..081ec42e2891 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +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 cloudresourcemanager_v3_generated_Organizations_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/create_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/create_project.php new file mode 100644 index 000000000000..e1c0c9bda86a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/create_project.php @@ -0,0 +1,72 @@ +createProject($project); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Project $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudresourcemanager_v3_generated_Projects_CreateProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/delete_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/delete_project.php new file mode 100644 index 000000000000..e199eeeac375 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/delete_project.php @@ -0,0 +1,110 @@ +deleteProject($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Project $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = ProjectsClient::projectName('[PROJECT]'); + + delete_project_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_Projects_DeleteProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_iam_policy.php new file mode 100644 index 000000000000..19010ec4aaef --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_iam_policy.php @@ -0,0 +1,68 @@ +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 cloudresourcemanager_v3_generated_Projects_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_project.php new file mode 100644 index 000000000000..a2e5ad9bf7b7 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_project.php @@ -0,0 +1,70 @@ +getProject($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 = ProjectsClient::projectName('[PROJECT]'); + + get_project_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_Projects_GetProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/list_projects.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/list_projects.php new file mode 100644 index 000000000000..14c8db847011 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/list_projects.php @@ -0,0 +1,80 @@ +listProjects($parent); + + /** @var Project $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 +{ + $parent = '[PARENT]'; + + list_projects_sample($parent); +} +// [END cloudresourcemanager_v3_generated_Projects_ListProjects_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/move_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/move_project.php new file mode 100644 index 000000000000..7b5a75dbbb91 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/move_project.php @@ -0,0 +1,95 @@ +moveProject($formattedName, $destinationParent); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Project $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = ProjectsClient::projectName('[PROJECT]'); + $destinationParent = '[DESTINATION_PARENT]'; + + move_project_sample($formattedName, $destinationParent); +} +// [END cloudresourcemanager_v3_generated_Projects_MoveProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/search_projects.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/search_projects.php new file mode 100644 index 000000000000..2a0fb32a7f5e --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/search_projects.php @@ -0,0 +1,67 @@ +searchProjects(); + + /** @var Project $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 cloudresourcemanager_v3_generated_Projects_SearchProjects_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/set_iam_policy.php new file mode 100644 index 000000000000..6560d06dc5ac --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/set_iam_policy.php @@ -0,0 +1,109 @@ +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 cloudresourcemanager_v3_generated_Projects_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/test_iam_permissions.php new file mode 100644 index 000000000000..5d68ce447dc2 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/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 cloudresourcemanager_v3_generated_Projects_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/undelete_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/undelete_project.php new file mode 100644 index 000000000000..ad1cbfecc2e5 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/undelete_project.php @@ -0,0 +1,88 @@ +undeleteProject($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Project $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = ProjectsClient::projectName('[PROJECT]'); + + undelete_project_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_Projects_UndeleteProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/update_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/update_project.php new file mode 100644 index 000000000000..d6e1884ddb8b --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/update_project.php @@ -0,0 +1,73 @@ +updateProject($project); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Project $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudresourcemanager_v3_generated_Projects_UpdateProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/create_tag_binding.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/create_tag_binding.php new file mode 100644 index 000000000000..2e06d03f8f5e --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/create_tag_binding.php @@ -0,0 +1,68 @@ +createTagBinding($tagBinding); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TagBinding $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudresourcemanager_v3_generated_TagBindings_CreateTagBinding_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/delete_tag_binding.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/delete_tag_binding.php new file mode 100644 index 000000000000..c469017971fa --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/delete_tag_binding.php @@ -0,0 +1,77 @@ +deleteTagBinding($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = TagBindingsClient::tagBindingName('[TAG_BINDING]'); + + delete_tag_binding_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_TagBindings_DeleteTagBinding_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_effective_tags.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_effective_tags.php new file mode 100644 index 000000000000..19126e25c07b --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_effective_tags.php @@ -0,0 +1,73 @@ +listEffectiveTags($parent); + + /** @var EffectiveTag $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 +{ + $parent = '[PARENT]'; + + list_effective_tags_sample($parent); +} +// [END cloudresourcemanager_v3_generated_TagBindings_ListEffectiveTags_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_tag_bindings.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_tag_bindings.php new file mode 100644 index 000000000000..a55f86dde818 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_tag_bindings.php @@ -0,0 +1,76 @@ +listTagBindings($parent); + + /** @var TagBinding $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 +{ + $parent = '[PARENT]'; + + list_tag_bindings_sample($parent); +} +// [END cloudresourcemanager_v3_generated_TagBindings_ListTagBindings_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/create_tag_hold.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/create_tag_hold.php new file mode 100644 index 000000000000..f895cf3a9be7 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/create_tag_hold.php @@ -0,0 +1,88 @@ +setHolder($tagHoldHolder); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $tagHoldsClient->createTagHold($formattedParent, $tagHold); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TagHold $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = TagHoldsClient::tagValueName('[TAG_VALUE]'); + $tagHoldHolder = '[HOLDER]'; + + create_tag_hold_sample($formattedParent, $tagHoldHolder); +} +// [END cloudresourcemanager_v3_generated_TagHolds_CreateTagHold_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/delete_tag_hold.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/delete_tag_hold.php new file mode 100644 index 000000000000..24f7a23098a9 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/delete_tag_hold.php @@ -0,0 +1,76 @@ +deleteTagHold($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = TagHoldsClient::tagHoldName('[TAG_VALUE]', '[TAG_HOLD]'); + + delete_tag_hold_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_TagHolds_DeleteTagHold_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/list_tag_holds.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/list_tag_holds.php new file mode 100644 index 000000000000..fd28f5d5a69e --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/list_tag_holds.php @@ -0,0 +1,72 @@ +listTagHolds($formattedParent); + + /** @var TagHold $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 = TagHoldsClient::tagValueName('[TAG_VALUE]'); + + list_tag_holds_sample($formattedParent); +} +// [END cloudresourcemanager_v3_generated_TagHolds_ListTagHolds_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/create_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/create_tag_key.php new file mode 100644 index 000000000000..83db769e3925 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/create_tag_key.php @@ -0,0 +1,89 @@ +setShortName($tagKeyShortName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $tagKeysClient->createTagKey($tagKey); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TagKey $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $tagKeyShortName = '[SHORT_NAME]'; + + create_tag_key_sample($tagKeyShortName); +} +// [END cloudresourcemanager_v3_generated_TagKeys_CreateTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/delete_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/delete_tag_key.php new file mode 100644 index 000000000000..8d6c969a27bf --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/delete_tag_key.php @@ -0,0 +1,81 @@ +deleteTagKey($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TagKey $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = TagKeysClient::tagKeyName('[TAG_KEY]'); + + delete_tag_key_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_TagKeys_DeleteTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_iam_policy.php new file mode 100644 index 000000000000..1ae478316841 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_iam_policy.php @@ -0,0 +1,71 @@ +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 cloudresourcemanager_v3_generated_TagKeys_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_namespaced_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_namespaced_tag_key.php new file mode 100644 index 000000000000..7a0fe86e4f2d --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_namespaced_tag_key.php @@ -0,0 +1,71 @@ +getNamespacedTagKey($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 = TagKeysClient::tagKeyName('[TAG_KEY]'); + + get_namespaced_tag_key_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_TagKeys_GetNamespacedTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_tag_key.php new file mode 100644 index 000000000000..9872587b80e4 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_tag_key.php @@ -0,0 +1,68 @@ +getTagKey($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 = TagKeysClient::tagKeyName('[TAG_KEY]'); + + get_tag_key_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_TagKeys_GetTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/list_tag_keys.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/list_tag_keys.php new file mode 100644 index 000000000000..58bc5e54713d --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/list_tag_keys.php @@ -0,0 +1,72 @@ +listTagKeys($parent); + + /** @var TagKey $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 +{ + $parent = '[PARENT]'; + + list_tag_keys_sample($parent); +} +// [END cloudresourcemanager_v3_generated_TagKeys_ListTagKeys_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/set_iam_policy.php new file mode 100644 index 000000000000..fb3fe9de4d09 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/set_iam_policy.php @@ -0,0 +1,73 @@ +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 cloudresourcemanager_v3_generated_TagKeys_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/test_iam_permissions.php new file mode 100644 index 000000000000..0cb526bf3989 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +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 cloudresourcemanager_v3_generated_TagKeys_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/update_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/update_tag_key.php new file mode 100644 index 000000000000..b14aaaf62e77 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/update_tag_key.php @@ -0,0 +1,86 @@ +setShortName($tagKeyShortName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $tagKeysClient->updateTagKey($tagKey); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TagKey $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $tagKeyShortName = '[SHORT_NAME]'; + + update_tag_key_sample($tagKeyShortName); +} +// [END cloudresourcemanager_v3_generated_TagKeys_UpdateTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/create_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/create_tag_value.php new file mode 100644 index 000000000000..065cdf9fcc05 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/create_tag_value.php @@ -0,0 +1,89 @@ +setShortName($tagValueShortName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $tagValuesClient->createTagValue($tagValue); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TagValue $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $tagValueShortName = '[SHORT_NAME]'; + + create_tag_value_sample($tagValueShortName); +} +// [END cloudresourcemanager_v3_generated_TagValues_CreateTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/delete_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/delete_tag_value.php new file mode 100644 index 000000000000..93ff983e0d90 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/delete_tag_value.php @@ -0,0 +1,80 @@ +deleteTagValue($formattedName); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TagValue $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = TagValuesClient::tagValueName('[TAG_VALUE]'); + + delete_tag_value_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_TagValues_DeleteTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_iam_policy.php new file mode 100644 index 000000000000..95a33594f7b7 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_iam_policy.php @@ -0,0 +1,71 @@ +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 cloudresourcemanager_v3_generated_TagValues_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_namespaced_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_namespaced_tag_value.php new file mode 100644 index 000000000000..9703e6d491af --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_namespaced_tag_value.php @@ -0,0 +1,76 @@ +getNamespacedTagValue($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 = TagValuesClient::tagValueName('[TAG_VALUE]'); + + get_namespaced_tag_value_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_TagValues_GetNamespacedTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_tag_value.php new file mode 100644 index 000000000000..b721ee8773d6 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_tag_value.php @@ -0,0 +1,68 @@ +getTagValue($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 = TagValuesClient::tagValueName('[TAG_VALUE]'); + + get_tag_value_sample($formattedName); +} +// [END cloudresourcemanager_v3_generated_TagValues_GetTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/list_tag_values.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/list_tag_values.php new file mode 100644 index 000000000000..960d00ca43a1 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/list_tag_values.php @@ -0,0 +1,70 @@ +listTagValues($parent); + + /** @var TagValue $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 +{ + $parent = '[PARENT]'; + + list_tag_values_sample($parent); +} +// [END cloudresourcemanager_v3_generated_TagValues_ListTagValues_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/set_iam_policy.php new file mode 100644 index 000000000000..556833ecbfe4 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/set_iam_policy.php @@ -0,0 +1,73 @@ +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 cloudresourcemanager_v3_generated_TagValues_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/test_iam_permissions.php new file mode 100644 index 000000000000..e9ef1aab1731 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +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 cloudresourcemanager_v3_generated_TagValues_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/update_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/update_tag_value.php new file mode 100644 index 000000000000..b5ed4916c82d --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/update_tag_value.php @@ -0,0 +1,86 @@ +setShortName($tagValueShortName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $tagValuesClient->updateTagValue($tagValue); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TagValue $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $tagValueShortName = '[SHORT_NAME]'; + + update_tag_value_sample($tagValueShortName); +} +// [END cloudresourcemanager_v3_generated_TagValues_UpdateTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/FoldersClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/FoldersClient.php new file mode 100644 index 000000000000..4bd8a842cfed --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/FoldersClient.php @@ -0,0 +1,34 @@ +createFolder($folder); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $foldersClient->createFolder($folder); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $foldersClient->resumeOperation($operationName, 'createFolder'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $foldersClient->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. + */ +class FoldersGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.resourcemanager.v3.Folders'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'cloudresourcemanager.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', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + + private static $folderNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/folders_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/folders_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/folders_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/folders_rest_client_config.php', + ], + ], + ]; + } + + private static function getFolderNameTemplate() + { + if (self::$folderNameTemplate == null) { + self::$folderNameTemplate = new PathTemplate('folders/{folder}'); + } + + return self::$folderNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'folder' => self::getFolderNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a folder + * resource. + * + * @param string $folder + * + * @return string The formatted folder resource. + */ + public static function folderName($folder) + { + return self::getFolderNameTemplate()->render([ + 'folder' => $folder, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - folder: folders/{folder} + * + * 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"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * 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 'cloudresourcemanager.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); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Creates a folder in the resource hierarchy. + * Returns an `Operation` which can be used to track the progress of the + * folder creation workflow. + * Upon success, the `Operation.response` field will be populated with the + * created Folder. + * + * In order to succeed, the addition of this new folder must not violate + * the folder naming, height, or fanout constraints. + * + * + The folder's `display_name` must be distinct from all other folders that + * share its parent. + * + The addition of the folder must not cause the active folder hierarchy + * to exceed a height of 10. Note, the full active + deleted folder hierarchy + * is allowed to reach a height of 20; this provides additional headroom when + * moving folders that contain deleted folders. + * + The addition of the folder must not cause the total number of folders + * under its parent to exceed 300. + * + * If the operation fails due to a folder constraint violation, some errors + * may be returned by the `CreateFolder` request, with status code + * `FAILED_PRECONDITION` and an error description. Other folder constraint + * violations will be communicated in the `Operation`, with the specific + * `PreconditionFailure` returned in the details list in the `Operation.error` + * field. + * + * The caller must have `resourcemanager.folders.create` permission on the + * identified parent. + * + * Sample code: + * ``` + * $foldersClient = new FoldersClient(); + * try { + * $folder = new Folder(); + * $operationResponse = $foldersClient->createFolder($folder); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $foldersClient->createFolder($folder); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $foldersClient->resumeOperation($operationName, 'createFolder'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $foldersClient->close(); + * } + * ``` + * + * @param Folder $folder Required. The folder being created, only the display name and parent will + * be consulted. All other fields will be ignored. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createFolder($folder, array $optionalArgs = []) + { + $request = new CreateFolderRequest(); + $request->setFolder($folder); + return $this->startOperationsCall('CreateFolder', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Requests deletion of a folder. The folder is moved into the + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + * state immediately, and is deleted approximately 30 days later. This method + * may only be called on an empty folder, where a folder is empty if it + * doesn't contain any folders or projects in the + * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If + * called on a folder in + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + * state the operation will result in a no-op success. + * The caller must have `resourcemanager.folders.delete` permission on the + * identified folder. + * + * Sample code: + * ``` + * $foldersClient = new FoldersClient(); + * try { + * $formattedName = $foldersClient->folderName('[FOLDER]'); + * $operationResponse = $foldersClient->deleteFolder($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $foldersClient->deleteFolder($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $foldersClient->resumeOperation($operationName, 'deleteFolder'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $foldersClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the folder to be deleted. + * Must be of the form `folders/{folder_id}`. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteFolder($name, array $optionalArgs = []) + { + $request = new DeleteFolderRequest(); + $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->startOperationsCall('DeleteFolder', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Retrieves a folder identified by the supplied resource name. + * Valid folder resource names have the format `folders/{folder_id}` + * (for example, `folders/1234`). + * The caller must have `resourcemanager.folders.get` permission on the + * identified folder. + * + * Sample code: + * ``` + * $foldersClient = new FoldersClient(); + * try { + * $formattedName = $foldersClient->folderName('[FOLDER]'); + * $response = $foldersClient->getFolder($formattedName); + * } finally { + * $foldersClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the folder to retrieve. + * Must be of the form `folders/{folder_id}`. + * @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\ResourceManager\V3\Folder + * + * @throws ApiException if the remote call fails + */ + public function getFolder($name, array $optionalArgs = []) + { + $request = new GetFolderRequest(); + $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('GetFolder', Folder::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a folder. The returned policy may be + * empty if no such policy or resource exists. The `resource` field should + * be the folder's resource name, for example: "folders/1234". + * The caller must have `resourcemanager.folders.getIamPolicy` permission + * on the identified folder. + * + * Sample code: + * ``` + * $foldersClient = new FoldersClient(); + * try { + * $resource = 'resource'; + * $response = $foldersClient->getIamPolicy($resource); + * } finally { + * $foldersClient->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(); + } + + /** + * Lists the folders that are direct descendants of supplied parent resource. + * `list()` provides a strongly consistent view of the folders underneath + * the specified parent resource. + * `list()` returns folders sorted based upon the (ascending) lexical ordering + * of their display_name. + * The caller must have `resourcemanager.folders.list` permission on the + * identified parent. + * + * Sample code: + * ``` + * $foldersClient = new FoldersClient(); + * try { + * $parent = 'parent'; + * // Iterate over pages of elements + * $pagedResponse = $foldersClient->listFolders($parent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $foldersClient->listFolders($parent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $foldersClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource whose folders are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * + * Access to this method is controlled by checking the + * `resourcemanager.folders.list` permission on the `parent`. + * @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 bool $showDeleted + * Optional. Controls whether folders in the + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + * state should be returned. Defaults to false. + * @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 listFolders($parent, array $optionalArgs = []) + { + $request = new ListFoldersRequest(); + $request->setParent($parent); + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['showDeleted'])) { + $request->setShowDeleted($optionalArgs['showDeleted']); + } + + return $this->getPagedListResponse('ListFolders', $optionalArgs, ListFoldersResponse::class, $request); + } + + /** + * Moves a folder under a new resource parent. + * Returns an `Operation` which can be used to track the progress of the + * folder move workflow. + * Upon success, the `Operation.response` field will be populated with the + * moved folder. + * Upon failure, a `FolderOperationError` categorizing the failure cause will + * be returned - if the failure occurs synchronously then the + * `FolderOperationError` will be returned in the `Status.details` field. + * If it occurs asynchronously, then the FolderOperation will be returned + * in the `Operation.error` field. + * In addition, the `Operation.metadata` field will be populated with a + * `FolderOperation` message as an aid to stateless clients. + * Folder moves will be rejected if they violate either the naming, height, + * or fanout constraints described in the + * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] + * documentation. The caller must have `resourcemanager.folders.move` + * permission on the folder's current and proposed new parent. + * + * Sample code: + * ``` + * $foldersClient = new FoldersClient(); + * try { + * $formattedName = $foldersClient->folderName('[FOLDER]'); + * $destinationParent = 'destination_parent'; + * $operationResponse = $foldersClient->moveFolder($formattedName, $destinationParent); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $foldersClient->moveFolder($formattedName, $destinationParent); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $foldersClient->resumeOperation($operationName, 'moveFolder'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $foldersClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the Folder to move. + * Must be of the form folders/{folder_id} + * @param string $destinationParent Required. The resource name of the folder or organization which should be + * the folder's new parent. Must be of the form `folders/{folder_id}` or + * `organizations/{org_id}`. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function moveFolder($name, $destinationParent, array $optionalArgs = []) + { + $request = new MoveFolderRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setDestinationParent($destinationParent); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('MoveFolder', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Search for folders that match specific filter criteria. + * `search()` provides an eventually consistent view of the folders a user has + * access to which meet the specified filter criteria. + * + * This will only return folders on which the caller has the + * permission `resourcemanager.folders.get`. + * + * Sample code: + * ``` + * $foldersClient = new FoldersClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $foldersClient->searchFolders(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $foldersClient->searchFolders(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $foldersClient->close(); + * } + * ``` + * + * @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 $query + * Optional. Search criteria used to select the folders to return. + * If no search criteria is specified then all accessible folders will be + * returned. + * + * Query expressions can be used to restrict results based upon displayName, + * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + * can be used along with the suffix wildcard symbol `*`. + * + * The `displayName` field in a query expression should use escaped quotes + * for values that include whitespace to prevent unexpected behavior. + * + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------| + * | displayName | Filters by displayName. | + * | parent | Filters by parent (for example: folders/123). | + * | state, lifecycleState | Filters by state. | + * ``` + * + * Some example queries are: + * + * * Query `displayName=Test*` returns Folder resources whose display name + * starts with "Test". + * * Query `state=ACTIVE` returns Folder resources with + * `state` set to `ACTIVE`. + * * Query `parent=folders/123` returns Folder resources that have + * `folders/123` as a parent resource. + * * Query `parent=folders/123 AND state=ACTIVE` returns active + * Folder resources that have `folders/123` as a parent resource. + * * Query `displayName=\\"Test String\\"` returns Folder resources with + * display names that include both "Test" and "String". + * @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 searchFolders(array $optionalArgs = []) + { + $request = new SearchFoldersRequest(); + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['query'])) { + $request->setQuery($optionalArgs['query']); + } + + return $this->getPagedListResponse('SearchFolders', $optionalArgs, SearchFoldersResponse::class, $request); + } + + /** + * Sets the access control policy on a folder, replacing any existing policy. + * The `resource` field should be the folder's resource name, for example: + * "folders/1234". + * The caller must have `resourcemanager.folders.setIamPolicy` permission + * on the identified folder. + * + * Sample code: + * ``` + * $foldersClient = new FoldersClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $foldersClient->setIamPolicy($resource, $policy); + * } finally { + * $foldersClient->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(); + } + + /** + * Returns permissions that a caller has on the specified folder. + * The `resource` field should be the folder's resource name, + * for example: "folders/1234". + * + * There are no permissions required for making this API call. + * + * Sample code: + * ``` + * $foldersClient = new FoldersClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $foldersClient->testIamPermissions($resource, $permissions); + * } finally { + * $foldersClient->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(); + } + + /** + * Cancels the deletion request for a folder. This method may be called on a + * folder in any state. If the folder is in the + * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the + * result will be a no-op success. In order to succeed, the folder's parent + * must be in the + * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In + * addition, reintroducing the folder into the tree must not violate folder + * naming, height, and fanout constraints described in the + * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] + * documentation. The caller must have `resourcemanager.folders.undelete` + * permission on the identified folder. + * + * Sample code: + * ``` + * $foldersClient = new FoldersClient(); + * try { + * $formattedName = $foldersClient->folderName('[FOLDER]'); + * $operationResponse = $foldersClient->undeleteFolder($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $foldersClient->undeleteFolder($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $foldersClient->resumeOperation($operationName, 'undeleteFolder'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $foldersClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the folder to undelete. + * Must be of the form `folders/{folder_id}`. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function undeleteFolder($name, array $optionalArgs = []) + { + $request = new UndeleteFolderRequest(); + $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->startOperationsCall('UndeleteFolder', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates a folder, changing its `display_name`. + * Changes to the folder `display_name` will be rejected if they violate + * either the `display_name` formatting rules or the naming constraints + * described in the + * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] + * documentation. + * + * The folder's `display_name` must start and end with a letter or digit, + * may contain letters, digits, spaces, hyphens and underscores and can be + * between 3 and 30 characters. This is captured by the regular expression: + * `[\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]`. + * The caller must have `resourcemanager.folders.update` permission on the + * identified folder. + * + * If the update fails due to the unique name constraint then a + * `PreconditionFailure` explaining this violation will be returned + * in the Status.details field. + * + * Sample code: + * ``` + * $foldersClient = new FoldersClient(); + * try { + * $folder = new Folder(); + * $updateMask = new FieldMask(); + * $operationResponse = $foldersClient->updateFolder($folder, $updateMask); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $foldersClient->updateFolder($folder, $updateMask); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $foldersClient->resumeOperation($operationName, 'updateFolder'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $foldersClient->close(); + * } + * ``` + * + * @param Folder $folder Required. The new definition of the Folder. It must include the `name` + * field, which cannot be changed. + * @param FieldMask $updateMask Required. Fields to be updated. + * Only the `display_name` can be updated. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateFolder($folder, $updateMask, array $optionalArgs = []) + { + $request = new UpdateFolderRequest(); + $requestParamHeaders = []; + $request->setFolder($folder); + $request->setUpdateMask($updateMask); + $requestParamHeaders['folder.name'] = $folder->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateFolder', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/OrganizationsGapicClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/OrganizationsGapicClient.php new file mode 100644 index 000000000000..c33665ddb15c --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/OrganizationsGapicClient.php @@ -0,0 +1,544 @@ +getIamPolicy($resource); + * } finally { + * $organizationsClient->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. + */ +class OrganizationsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.resourcemanager.v3.Organizations'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'cloudresourcemanager.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', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + + private static $organizationNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/organizations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/organizations_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/organizations_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/organizations_rest_client_config.php', + ], + ], + ]; + } + + private static function getOrganizationNameTemplate() + { + if (self::$organizationNameTemplate == null) { + self::$organizationNameTemplate = new PathTemplate('organizations/{organization}'); + } + + return self::$organizationNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'organization' => self::getOrganizationNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a organization + * resource. + * + * @param string $organization + * + * @return string The formatted organization resource. + */ + public static function organizationName($organization) + { + return self::getOrganizationNameTemplate()->render([ + 'organization' => $organization, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - organization: organizations/{organization} + * + * 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 'cloudresourcemanager.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); + } + + /** + * Gets the access control policy for an organization resource. The policy may + * be empty if no such policy or resource exists. The `resource` field should + * be the organization's resource name, for example: "organizations/123". + * + * Authorization requires the IAM permission + * `resourcemanager.organizations.getIamPolicy` on the specified organization. + * + * Sample code: + * ``` + * $organizationsClient = new OrganizationsClient(); + * try { + * $resource = 'resource'; + * $response = $organizationsClient->getIamPolicy($resource); + * } finally { + * $organizationsClient->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(); + } + + /** + * Fetches an organization resource identified by the specified resource name. + * + * Sample code: + * ``` + * $organizationsClient = new OrganizationsClient(); + * try { + * $formattedName = $organizationsClient->organizationName('[ORGANIZATION]'); + * $response = $organizationsClient->getOrganization($formattedName); + * } finally { + * $organizationsClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the Organization to fetch. This is the + * organization's relative path in the API, formatted as + * "organizations/[organizationId]". For example, "organizations/1234". + * @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\ResourceManager\V3\Organization + * + * @throws ApiException if the remote call fails + */ + public function getOrganization($name, array $optionalArgs = []) + { + $request = new GetOrganizationRequest(); + $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('GetOrganization', Organization::class, $optionalArgs, $request)->wait(); + } + + /** + * Searches organization resources that are visible to the user and satisfy + * the specified filter. This method returns organizations in an unspecified + * order. New organizations do not necessarily appear at the end of the + * results, and may take a small amount of time to appear. + * + * Search will only return organizations on which the user has the permission + * `resourcemanager.organizations.get` + * + * Sample code: + * ``` + * $organizationsClient = new OrganizationsClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $organizationsClient->searchOrganizations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $organizationsClient->searchOrganizations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $organizationsClient->close(); + * } + * ``` + * + * @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 $query + * Optional. An optional query string used to filter the Organizations to + * return in the response. Query rules are case-insensitive. + * + * + * ``` + * | Field | Description | + * |------------------|--------------------------------------------| + * | directoryCustomerId, owner.directoryCustomerId | Filters by directory + * customer id. | + * | domain | Filters by domain. | + * ``` + * + * Organizations may be queried by `directoryCustomerId` or by + * `domain`, where the domain is a G Suite domain, for example: + * + * * Query `directorycustomerid:123456789` returns Organization + * resources with `owner.directory_customer_id` equal to `123456789`. + * * Query `domain:google.com` returns Organization resources corresponding + * to the domain `google.com`. + * @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 searchOrganizations(array $optionalArgs = []) + { + $request = new SearchOrganizationsRequest(); + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['query'])) { + $request->setQuery($optionalArgs['query']); + } + + return $this->getPagedListResponse('SearchOrganizations', $optionalArgs, SearchOrganizationsResponse::class, $request); + } + + /** + * Sets the access control policy on an organization resource. Replaces any + * existing policy. The `resource` field should be the organization's resource + * name, for example: "organizations/123". + * + * Authorization requires the IAM permission + * `resourcemanager.organizations.setIamPolicy` on the specified organization. + * + * Sample code: + * ``` + * $organizationsClient = new OrganizationsClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $organizationsClient->setIamPolicy($resource, $policy); + * } finally { + * $organizationsClient->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(); + } + + /** + * Returns the permissions that a caller has on the specified organization. + * The `resource` field should be the organization's resource name, + * for example: "organizations/123". + * + * There are no permissions required for making this API call. + * + * Sample code: + * ``` + * $organizationsClient = new OrganizationsClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $organizationsClient->testIamPermissions($resource, $permissions); + * } finally { + * $organizationsClient->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(); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/ProjectsGapicClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/ProjectsGapicClient.php new file mode 100644 index 000000000000..ba19e02170e3 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/ProjectsGapicClient.php @@ -0,0 +1,1139 @@ +createProject($project); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $projectsClient->createProject($project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'createProject'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $projectsClient->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. + */ +class ProjectsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.resourcemanager.v3.Projects'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'cloudresourcemanager.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', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + + private static $projectNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/projects_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/projects_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/projects_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/projects_rest_client_config.php', + ], + ], + ]; + } + + private static function getProjectNameTemplate() + { + if (self::$projectNameTemplate == null) { + self::$projectNameTemplate = new PathTemplate('projects/{project}'); + } + + return self::$projectNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'project' => self::getProjectNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName($project) + { + return self::getProjectNameTemplate()->render([ + 'project' => $project, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - project: projects/{project} + * + * 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"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * 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 'cloudresourcemanager.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); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Request that a new project be created. The result is an `Operation` which + * can be used to track the creation process. This process usually takes a few + * seconds, but can sometimes take much longer. The tracking `Operation` is + * automatically deleted after a few hours, so there is no need to call + * `DeleteOperation`. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $project = new Project(); + * $operationResponse = $projectsClient->createProject($project); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $projectsClient->createProject($project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'createProject'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $projectsClient->close(); + * } + * ``` + * + * @param Project $project Required. The Project to create. + * + * Project ID is required. If the requested ID is unavailable, the request + * fails. + * + * If the `parent` field is set, the `resourcemanager.projects.create` + * permission is checked on the parent resource. If no parent is set and + * the authorization credentials belong to an Organization, the parent + * will be set to that Organization. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createProject($project, array $optionalArgs = []) + { + $request = new CreateProjectRequest(); + $request->setProject($project); + return $this->startOperationsCall('CreateProject', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Marks the project identified by the specified + * `name` (for example, `projects/415104041262`) for deletion. + * + * This method will only affect the project if it has a lifecycle state of + * [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE]. + * + * This method changes the Project's lifecycle state from + * [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] + * to + * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. + * The deletion starts at an unspecified time, + * at which point the Project is no longer accessible. + * + * Until the deletion completes, you can check the lifecycle state + * checked by retrieving the project with [GetProject] + * [google.cloud.resourcemanager.v3.Projects.GetProject], + * and the project remains visible to [ListProjects] + * [google.cloud.resourcemanager.v3.Projects.ListProjects]. + * However, you cannot update the project. + * + * After the deletion completes, the project is not retrievable by + * the [GetProject] + * [google.cloud.resourcemanager.v3.Projects.GetProject], + * [ListProjects] + * [google.cloud.resourcemanager.v3.Projects.ListProjects], and + * [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] + * methods. + * + * This method behaves idempotently, such that deleting a `DELETE_REQUESTED` + * project will not cause an error, but also won't do anything. + * + * The caller must have `resourcemanager.projects.delete` permissions for this + * project. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $formattedName = $projectsClient->projectName('[PROJECT]'); + * $operationResponse = $projectsClient->deleteProject($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $projectsClient->deleteProject($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'deleteProject'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $projectsClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the Project (for example, `projects/415104041262`). + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteProject($name, array $optionalArgs = []) + { + $request = new DeleteProjectRequest(); + $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->startOperationsCall('DeleteProject', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Returns the IAM access control policy for the specified project, in the + * format `projects/{ProjectIdOrNumber}` e.g. projects/123. + * Permission is denied if the policy or the resource do not exist. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $resource = 'resource'; + * $response = $projectsClient->getIamPolicy($resource); + * } finally { + * $projectsClient->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(); + } + + /** + * Retrieves the project identified by the specified `name` (for example, + * `projects/415104041262`). + * + * The caller must have `resourcemanager.projects.get` permission + * for this project. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $formattedName = $projectsClient->projectName('[PROJECT]'); + * $response = $projectsClient->getProject($formattedName); + * } finally { + * $projectsClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the project (for example, `projects/415104041262`). + * @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\ResourceManager\V3\Project + * + * @throws ApiException if the remote call fails + */ + public function getProject($name, array $optionalArgs = []) + { + $request = new GetProjectRequest(); + $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('GetProject', Project::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists projects that are direct children of the specified folder or + * organization resource. `list()` provides a strongly consistent view of the + * projects underneath the specified parent resource. `list()` returns + * projects sorted based upon the (ascending) lexical ordering of their + * `display_name`. The caller must have `resourcemanager.projects.list` + * permission on the identified parent. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $parent = 'parent'; + * // Iterate over pages of elements + * $pagedResponse = $projectsClient->listProjects($parent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $projectsClient->listProjects($parent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $projectsClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the parent resource whose projects are being listed. + * Only children of this parent resource are listed; descendants are not + * listed. + * + * If the parent is a folder, use the value `folders/{folder_id}`. If the + * parent is an organization, use the value `organizations/{org_id}`. + * @param array $optionalArgs { + * Optional. + * + * @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 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 bool $showDeleted + * Optional. Indicate that projects in the `DELETE_REQUESTED` state should + * also be returned. Normally only `ACTIVE` projects are returned. + * @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 listProjects($parent, array $optionalArgs = []) + { + $request = new ListProjectsRequest(); + $request->setParent($parent); + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['showDeleted'])) { + $request->setShowDeleted($optionalArgs['showDeleted']); + } + + return $this->getPagedListResponse('ListProjects', $optionalArgs, ListProjectsResponse::class, $request); + } + + /** + * Move a project to another place in your resource hierarchy, under a new + * resource parent. + * + * Returns an operation which can be used to track the process of the project + * move workflow. + * Upon success, the `Operation.response` field will be populated with the + * moved project. + * + * The caller must have `resourcemanager.projects.move` permission on the + * project, on the project's current and proposed new parent. + * + * If project has no current parent, or it currently does not have an + * associated organization resource, you will also need the + * `resourcemanager.projects.setIamPolicy` permission in the project. + * + * + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $formattedName = $projectsClient->projectName('[PROJECT]'); + * $destinationParent = 'destination_parent'; + * $operationResponse = $projectsClient->moveProject($formattedName, $destinationParent); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $projectsClient->moveProject($formattedName, $destinationParent); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'moveProject'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $projectsClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the project to move. + * @param string $destinationParent Required. The new parent to move the Project under. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function moveProject($name, $destinationParent, array $optionalArgs = []) + { + $request = new MoveProjectRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setDestinationParent($destinationParent); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('MoveProject', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Search for projects that the caller has both `resourcemanager.projects.get` + * permission on, and also satisfy the specified query. + * + * This method returns projects in an unspecified order. + * + * This method is eventually consistent with project mutations; this means + * that a newly created project may not appear in the results or recent + * updates to an existing project may not be reflected in the results. To + * retrieve the latest state of a project, use the + * [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject] method. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $projectsClient->searchProjects(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $projectsClient->searchProjects(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $projectsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $query + * Optional. A query string for searching for projects that the caller has + * `resourcemanager.projects.get` permission to. If multiple fields are + * included in the query, then it will return results that match any of the + * fields. Some eligible fields are: + * + * - **`displayName`, `name`**: Filters by displayName. + * - **`parent`**: Project's parent (for example: `folders/123`, + * `organizations/*`). Prefer `parent` field over `parent.type` and + * `parent.id`. + * - **`parent.type`**: Parent's type: `folder` or `organization`. + * - **`parent.id`**: Parent's id number (for example: `123`). + * - **`id`, `projectId`**: Filters by projectId. + * - **`state`, `lifecycleState`**: Filters by state. + * - **`labels`**: Filters by label name or value. + * - **`labels.` (where `` is the name of a label)**: Filters by label + * name. + * + * Search expressions are case insensitive. + * + * Some examples queries: + * + * + * - **`name:how*`**: The project's name starts with "how". + * - **`name:Howl`**: The project's name is `Howl` or `howl`. + * - **`name:HOWL`**: Equivalent to above. + * - **`NAME:howl`**: Equivalent to above. + * - **`labels.color:*`**: The project has the label `color`. + * - **`labels.color:red`**: The project's label `color` has the value `red`. + * - **`labels.color:red labels.size:big`**: The project's label `color` has + * the value `red` or its label `size` has the value `big`. + * + * If no query is specified, the call will return projects for which the user + * has the `resourcemanager.projects.get` permission. + * @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 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 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 searchProjects(array $optionalArgs = []) + { + $request = new SearchProjectsRequest(); + if (isset($optionalArgs['query'])) { + $request->setQuery($optionalArgs['query']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + return $this->getPagedListResponse('SearchProjects', $optionalArgs, SearchProjectsResponse::class, $request); + } + + /** + * Sets the IAM access control policy for the specified project, in the + * format `projects/{ProjectIdOrNumber}` e.g. projects/123. + * + * CAUTION: This method will replace the existing policy, and cannot be used + * to append additional IAM settings. + * + * Note: Removing service accounts from policies or changing their roles can + * render services completely inoperable. It is important to understand how + * the service account is being used before removing or updating its roles. + * + * The following constraints apply when using `setIamPolicy()`: + * + * + Project does not support `allUsers` and `allAuthenticatedUsers` as + * `members` in a `Binding` of a `Policy`. + * + * + The owner role can be granted to a `user`, `serviceAccount`, or a group + * that is part of an organization. For example, + * group@myownpersonaldomain.com could be added as an owner to a project in + * the myownpersonaldomain.com organization, but not the examplepetstore.com + * organization. + * + * + Service accounts can be made owners of a project directly + * without any restrictions. However, to be added as an owner, a user must be + * invited using the Cloud Platform console and must accept the invitation. + * + * + A user cannot be granted the owner role using `setIamPolicy()`. The user + * must be granted the owner role using the Cloud Platform Console and must + * explicitly accept the invitation. + * + * + Invitations to grant the owner role cannot be sent using + * `setIamPolicy()`; + * they must be sent only using the Cloud Platform Console. + * + * + If the project is not part of an organization, there must be at least + * one owner who has accepted the Terms of Service (ToS) agreement in the + * policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner + * from the policy will fail. This restriction also applies to legacy + * projects that no longer have owners who have accepted the ToS. Edits to + * IAM policies will be rejected until the lack of a ToS-accepting owner is + * rectified. If the project is part of an organization, you can remove all + * owners, potentially making the organization inaccessible. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $projectsClient->setIamPolicy($resource, $policy); + * } finally { + * $projectsClient->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(); + } + + /** + * Returns permissions that a caller has on the specified project, in the + * format `projects/{ProjectIdOrNumber}` e.g. projects/123.. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $projectsClient->testIamPermissions($resource, $permissions); + * } finally { + * $projectsClient->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(); + } + + /** + * Restores the project identified by the specified + * `name` (for example, `projects/415104041262`). + * You can only use this method for a project that has a lifecycle state of + * [DELETE_REQUESTED] + * [Projects.State.DELETE_REQUESTED]. + * After deletion starts, the project cannot be restored. + * + * The caller must have `resourcemanager.projects.undelete` permission for + * this project. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $formattedName = $projectsClient->projectName('[PROJECT]'); + * $operationResponse = $projectsClient->undeleteProject($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $projectsClient->undeleteProject($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'undeleteProject'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $projectsClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the project (for example, `projects/415104041262`). + * + * Required. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function undeleteProject($name, array $optionalArgs = []) + { + $request = new UndeleteProjectRequest(); + $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->startOperationsCall('UndeleteProject', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the `display_name` and labels of the project identified by the + * specified `name` (for example, `projects/415104041262`). Deleting all + * labels requires an update mask for labels field. + * + * The caller must have `resourcemanager.projects.update` permission for this + * project. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $project = new Project(); + * $operationResponse = $projectsClient->updateProject($project); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $projectsClient->updateProject($project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'updateProject'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $projectsClient->close(); + * } + * ``` + * + * @param Project $project Required. The new definition of the project. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. An update mask to selectively update fields. + * @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\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateProject($project, array $optionalArgs = []) + { + $request = new UpdateProjectRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project.name'] = $project->getName(); + 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->startOperationsCall('UpdateProject', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagBindingsGapicClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagBindingsGapicClient.php new file mode 100644 index 000000000000..707b98efe90c --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagBindingsGapicClient.php @@ -0,0 +1,574 @@ +createTagBinding($tagBinding); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $tagBindingsClient->createTagBinding($tagBinding); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $tagBindingsClient->resumeOperation($operationName, 'createTagBinding'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $tagBindingsClient->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. + */ +class TagBindingsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.resourcemanager.v3.TagBindings'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'cloudresourcemanager.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', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + + private static $tagBindingNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/tag_bindings_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/tag_bindings_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/tag_bindings_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/tag_bindings_rest_client_config.php', + ], + ], + ]; + } + + private static function getTagBindingNameTemplate() + { + if (self::$tagBindingNameTemplate == null) { + self::$tagBindingNameTemplate = new PathTemplate('tagBindings/{tag_binding}'); + } + + return self::$tagBindingNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'tagBinding' => self::getTagBindingNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a tag_binding + * resource. + * + * @param string $tagBinding + * + * @return string The formatted tag_binding resource. + */ + public static function tagBindingName($tagBinding) + { + return self::getTagBindingNameTemplate()->render([ + 'tag_binding' => $tagBinding, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - tagBinding: tagBindings/{tag_binding} + * + * 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"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * 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 'cloudresourcemanager.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); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Creates a TagBinding between a TagValue and a Google Cloud resource. + * + * Sample code: + * ``` + * $tagBindingsClient = new TagBindingsClient(); + * try { + * $tagBinding = new TagBinding(); + * $operationResponse = $tagBindingsClient->createTagBinding($tagBinding); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $tagBindingsClient->createTagBinding($tagBinding); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $tagBindingsClient->resumeOperation($operationName, 'createTagBinding'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $tagBindingsClient->close(); + * } + * ``` + * + * @param TagBinding $tagBinding Required. The TagBinding to be created. + * @param array $optionalArgs { + * Optional. + * + * @type bool $validateOnly + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * @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\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createTagBinding($tagBinding, array $optionalArgs = []) + { + $request = new CreateTagBindingRequest(); + $request->setTagBinding($tagBinding); + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + return $this->startOperationsCall('CreateTagBinding', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a TagBinding. + * + * Sample code: + * ``` + * $tagBindingsClient = new TagBindingsClient(); + * try { + * $formattedName = $tagBindingsClient->tagBindingName('[TAG_BINDING]'); + * $operationResponse = $tagBindingsClient->deleteTagBinding($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $tagBindingsClient->deleteTagBinding($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $tagBindingsClient->resumeOperation($operationName, 'deleteTagBinding'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $tagBindingsClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the TagBinding. This is a String of the form: + * `tagBindings/{id}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteTagBinding($name, array $optionalArgs = []) + { + $request = new DeleteTagBindingRequest(); + $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->startOperationsCall('DeleteTagBinding', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Return a list of effective tags for the given Google Cloud resource, as + * specified in `parent`. + * + * Sample code: + * ``` + * $tagBindingsClient = new TagBindingsClient(); + * try { + * $parent = 'parent'; + * // Iterate over pages of elements + * $pagedResponse = $tagBindingsClient->listEffectiveTags($parent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $tagBindingsClient->listEffectiveTags($parent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $tagBindingsClient->close(); + * } + * ``` + * + * @param string $parent Required. The full resource name of a resource for which you want to list + * the effective tags. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * @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 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 listEffectiveTags($parent, array $optionalArgs = []) + { + $request = new ListEffectiveTagsRequest(); + $request->setParent($parent); + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + return $this->getPagedListResponse('ListEffectiveTags', $optionalArgs, ListEffectiveTagsResponse::class, $request); + } + + /** + * Lists the TagBindings for the given Google Cloud resource, as specified + * with `parent`. + * + * NOTE: The `parent` field is expected to be a full resource name: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * + * Sample code: + * ``` + * $tagBindingsClient = new TagBindingsClient(); + * try { + * $parent = 'parent'; + * // Iterate over pages of elements + * $pagedResponse = $tagBindingsClient->listTagBindings($parent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $tagBindingsClient->listTagBindings($parent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $tagBindingsClient->close(); + * } + * ``` + * + * @param string $parent Required. The full resource name of a resource for which you want to list + * existing TagBindings. E.g. + * "//cloudresourcemanager.googleapis.com/projects/123" + * @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 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 listTagBindings($parent, array $optionalArgs = []) + { + $request = new ListTagBindingsRequest(); + $request->setParent($parent); + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + return $this->getPagedListResponse('ListTagBindings', $optionalArgs, ListTagBindingsResponse::class, $request); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagHoldsGapicClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagHoldsGapicClient.php new file mode 100644 index 000000000000..af887171c517 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagHoldsGapicClient.php @@ -0,0 +1,569 @@ +tagValueName('[TAG_VALUE]'); + * $tagHold = new TagHold(); + * $operationResponse = $tagHoldsClient->createTagHold($formattedParent, $tagHold); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $tagHoldsClient->createTagHold($formattedParent, $tagHold); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $tagHoldsClient->resumeOperation($operationName, 'createTagHold'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $tagHoldsClient->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. + */ +class TagHoldsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.resourcemanager.v3.TagHolds'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'cloudresourcemanager.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', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + + private static $tagHoldNameTemplate; + + private static $tagValueNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/tag_holds_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/tag_holds_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/tag_holds_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/tag_holds_rest_client_config.php', + ], + ], + ]; + } + + private static function getTagHoldNameTemplate() + { + if (self::$tagHoldNameTemplate == null) { + self::$tagHoldNameTemplate = new PathTemplate('tagValues/{tag_value}/tagHolds/{tag_hold}'); + } + + return self::$tagHoldNameTemplate; + } + + private static function getTagValueNameTemplate() + { + if (self::$tagValueNameTemplate == null) { + self::$tagValueNameTemplate = new PathTemplate('tagValues/{tag_value}'); + } + + return self::$tagValueNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'tagHold' => self::getTagHoldNameTemplate(), + 'tagValue' => self::getTagValueNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a tag_hold + * resource. + * + * @param string $tagValue + * @param string $tagHold + * + * @return string The formatted tag_hold resource. + */ + public static function tagHoldName($tagValue, $tagHold) + { + return self::getTagHoldNameTemplate()->render([ + 'tag_value' => $tagValue, + 'tag_hold' => $tagHold, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a tag_value + * resource. + * + * @param string $tagValue + * + * @return string The formatted tag_value resource. + */ + public static function tagValueName($tagValue) + { + return self::getTagValueNameTemplate()->render([ + 'tag_value' => $tagValue, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - tagHold: tagValues/{tag_value}/tagHolds/{tag_hold} + * - tagValue: tagValues/{tag_value} + * + * 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"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * 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 'cloudresourcemanager.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); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same + * resource and origin exists under the same TagValue. + * + * Sample code: + * ``` + * $tagHoldsClient = new TagHoldsClient(); + * try { + * $formattedParent = $tagHoldsClient->tagValueName('[TAG_VALUE]'); + * $tagHold = new TagHold(); + * $operationResponse = $tagHoldsClient->createTagHold($formattedParent, $tagHold); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $tagHoldsClient->createTagHold($formattedParent, $tagHold); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $tagHoldsClient->resumeOperation($operationName, 'createTagHold'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $tagHoldsClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the TagHold's parent TagValue. Must be of + * the form: `tagValues/{tag-value-id}`. + * @param TagHold $tagHold Required. The TagHold to be created. + * @param array $optionalArgs { + * Optional. + * + * @type bool $validateOnly + * Optional. Set to true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * @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\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createTagHold($parent, $tagHold, array $optionalArgs = []) + { + $request = new CreateTagHoldRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setTagHold($tagHold); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateTagHold', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a TagHold. + * + * Sample code: + * ``` + * $tagHoldsClient = new TagHoldsClient(); + * try { + * $formattedName = $tagHoldsClient->tagHoldName('[TAG_VALUE]', '[TAG_HOLD]'); + * $operationResponse = $tagHoldsClient->deleteTagHold($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $tagHoldsClient->deleteTagHold($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $tagHoldsClient->resumeOperation($operationName, 'deleteTagHold'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $tagHoldsClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the TagHold to delete. Must be of the form: + * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. + * @param array $optionalArgs { + * Optional. + * + * @type bool $validateOnly + * Optional. Set to true to perform the validations necessary for deleting the + * resource, but not actually perform the action. + * @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\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteTagHold($name, array $optionalArgs = []) + { + $request = new DeleteTagHoldRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteTagHold', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Lists TagHolds under a TagValue. + * + * Sample code: + * ``` + * $tagHoldsClient = new TagHoldsClient(); + * try { + * $formattedParent = $tagHoldsClient->tagValueName('[TAG_VALUE]'); + * // Iterate over pages of elements + * $pagedResponse = $tagHoldsClient->listTagHolds($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $tagHoldsClient->listTagHolds($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $tagHoldsClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the parent TagValue. Must be of the form: + * `tagValues/{tag-value-id}`. + * @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. Criteria used to select a subset of TagHolds parented by the + * TagValue to return. This field follows the syntax defined by aip.dev/160; + * the `holder` and `origin` fields are supported for filtering. Currently + * only `AND` syntax is supported. Some example queries are: + * + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + * * `origin = 35678234` + * * `holder = + * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group + * AND origin = 35678234` + * @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 listTagHolds($parent, array $optionalArgs = []) + { + $request = new ListTagHoldsRequest(); + $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']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListTagHolds', $optionalArgs, ListTagHoldsResponse::class, $request); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagKeysGapicClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagKeysGapicClient.php new file mode 100644 index 000000000000..140f7888bd6a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagKeysGapicClient.php @@ -0,0 +1,856 @@ +createTagKey($tagKey); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $tagKeysClient->createTagKey($tagKey); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $tagKeysClient->resumeOperation($operationName, 'createTagKey'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $tagKeysClient->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. + */ +class TagKeysGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.resourcemanager.v3.TagKeys'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'cloudresourcemanager.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', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + + private static $tagKeyNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/tag_keys_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/tag_keys_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/tag_keys_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/tag_keys_rest_client_config.php', + ], + ], + ]; + } + + private static function getTagKeyNameTemplate() + { + if (self::$tagKeyNameTemplate == null) { + self::$tagKeyNameTemplate = new PathTemplate('tagKeys/{tag_key}'); + } + + return self::$tagKeyNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'tagKey' => self::getTagKeyNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a tag_key + * resource. + * + * @param string $tagKey + * + * @return string The formatted tag_key resource. + */ + public static function tagKeyName($tagKey) + { + return self::getTagKeyNameTemplate()->render([ + 'tag_key' => $tagKey, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - tagKey: tagKeys/{tag_key} + * + * 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"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * 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 'cloudresourcemanager.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); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Creates a new TagKey. If another request with the same parameters is + * sent while the original request is in process, the second request + * will receive an error. A maximum of 1000 TagKeys can exist under a parent + * at any given time. + * + * Sample code: + * ``` + * $tagKeysClient = new TagKeysClient(); + * try { + * $tagKey = new TagKey(); + * $operationResponse = $tagKeysClient->createTagKey($tagKey); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $tagKeysClient->createTagKey($tagKey); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $tagKeysClient->resumeOperation($operationName, 'createTagKey'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $tagKeysClient->close(); + * } + * ``` + * + * @param TagKey $tagKey Required. The TagKey to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * @param array $optionalArgs { + * Optional. + * + * @type bool $validateOnly + * Optional. Set to true to perform validations necessary for creating the + * resource, but not actually perform the action. + * @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\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createTagKey($tagKey, array $optionalArgs = []) + { + $request = new CreateTagKeyRequest(); + $request->setTagKey($tagKey); + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + return $this->startOperationsCall('CreateTagKey', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a TagKey. The TagKey cannot be deleted if it has any child + * TagValues. + * + * Sample code: + * ``` + * $tagKeysClient = new TagKeysClient(); + * try { + * $formattedName = $tagKeysClient->tagKeyName('[TAG_KEY]'); + * $operationResponse = $tagKeysClient->deleteTagKey($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $tagKeysClient->deleteTagKey($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $tagKeysClient->resumeOperation($operationName, 'deleteTagKey'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $tagKeysClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of a TagKey to be deleted in the format + * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or + * it will not be deleted successfully. + * @param array $optionalArgs { + * Optional. + * + * @type bool $validateOnly + * Optional. Set as true to perform validations necessary for deletion, but + * not actually perform the action. + * @type string $etag + * Optional. The etag known to the client for the expected state of the + * TagKey. This is to be used for optimistic concurrency. + * @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\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteTagKey($name, array $optionalArgs = []) + { + $request = new DeleteTagKeyRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteTagKey', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets the access control policy for a TagKey. The returned policy may be + * empty if no such policy or resource exists. The `resource` field should + * be the TagKey's resource name. For example, "tagKeys/1234". + * The caller must have + * `cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy` permission on + * the specified TagKey. + * + * Sample code: + * ``` + * $tagKeysClient = new TagKeysClient(); + * try { + * $resource = 'resource'; + * $response = $tagKeysClient->getIamPolicy($resource); + * } finally { + * $tagKeysClient->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(); + } + + /** + * Retrieves a TagKey by its namespaced name. + * This method will return `PERMISSION_DENIED` if the key does not exist + * or the user does not have permission to view it. + * + * Sample code: + * ``` + * $tagKeysClient = new TagKeysClient(); + * try { + * $formattedName = $tagKeysClient->tagKeyName('[TAG_KEY]'); + * $response = $tagKeysClient->getNamespacedTagKey($formattedName); + * } finally { + * $tagKeysClient->close(); + * } + * ``` + * + * @param string $name Required. A namespaced tag key name in the format + * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name + * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short + * name "bar" under the project `r2-d2`. + * @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\ResourceManager\V3\TagKey + * + * @throws ApiException if the remote call fails + */ + public function getNamespacedTagKey($name, array $optionalArgs = []) + { + $request = new GetNamespacedTagKeyRequest(); + $request->setName($name); + return $this->startCall('GetNamespacedTagKey', TagKey::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a TagKey. This method will return `PERMISSION_DENIED` if the + * key does not exist or the user does not have permission to view it. + * + * Sample code: + * ``` + * $tagKeysClient = new TagKeysClient(); + * try { + * $formattedName = $tagKeysClient->tagKeyName('[TAG_KEY]'); + * $response = $tagKeysClient->getTagKey($formattedName); + * } finally { + * $tagKeysClient->close(); + * } + * ``` + * + * @param string $name Required. A resource name in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * @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\ResourceManager\V3\TagKey + * + * @throws ApiException if the remote call fails + */ + public function getTagKey($name, array $optionalArgs = []) + { + $request = new GetTagKeyRequest(); + $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('GetTagKey', TagKey::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists all TagKeys for a parent resource. + * + * Sample code: + * ``` + * $tagKeysClient = new TagKeysClient(); + * try { + * $parent = 'parent'; + * // Iterate over pages of elements + * $pagedResponse = $tagKeysClient->listTagKeys($parent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $tagKeysClient->listTagKeys($parent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $tagKeysClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the TagKey's parent. + * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + * `projects/{project_number}` + * @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 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 listTagKeys($parent, array $optionalArgs = []) + { + $request = new ListTagKeysRequest(); + $request->setParent($parent); + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + return $this->getPagedListResponse('ListTagKeys', $optionalArgs, ListTagKeysResponse::class, $request); + } + + /** + * Sets the access control policy on a TagKey, replacing any existing + * policy. The `resource` field should be the TagKey's resource name. + * For example, "tagKeys/1234". + * The caller must have `resourcemanager.tagKeys.setIamPolicy` permission + * on the identified tagValue. + * + * Sample code: + * ``` + * $tagKeysClient = new TagKeysClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $tagKeysClient->setIamPolicy($resource, $policy); + * } finally { + * $tagKeysClient->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(); + } + + /** + * Returns permissions that a caller has on the specified TagKey. + * The `resource` field should be the TagKey's resource name. + * For example, "tagKeys/1234". + * + * There are no permissions required for making this API call. + * + * Sample code: + * ``` + * $tagKeysClient = new TagKeysClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $tagKeysClient->testIamPermissions($resource, $permissions); + * } finally { + * $tagKeysClient->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 the attributes of the TagKey resource. + * + * Sample code: + * ``` + * $tagKeysClient = new TagKeysClient(); + * try { + * $tagKey = new TagKey(); + * $operationResponse = $tagKeysClient->updateTagKey($tagKey); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $tagKeysClient->updateTagKey($tagKey); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $tagKeysClient->resumeOperation($operationName, 'updateTagKey'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $tagKeysClient->close(); + * } + * ``` + * + * @param TagKey $tagKey Required. The new definition of the TagKey. Only the `description` and + * `etag` fields can be updated by this request. If the `etag` field is not + * empty, it must match the `etag` field of the existing tag key. Otherwise, + * `ABORTED` will be returned. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Fields to be updated. The mask may only contain `description` or + * `etag`. If omitted entirely, both `description` and `etag` are assumed to + * be significant. + * @type bool $validateOnly + * Set as true to perform validations necessary for updating the resource, but + * not actually perform the action. + * @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\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateTagKey($tagKey, array $optionalArgs = []) + { + $request = new UpdateTagKeyRequest(); + $requestParamHeaders = []; + $request->setTagKey($tagKey); + $requestParamHeaders['tag_key.name'] = $tagKey->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateTagKey', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagValuesGapicClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagValuesGapicClient.php new file mode 100644 index 000000000000..f0110578e16f --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagValuesGapicClient.php @@ -0,0 +1,856 @@ +createTagValue($tagValue); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $tagValuesClient->createTagValue($tagValue); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $tagValuesClient->resumeOperation($operationName, 'createTagValue'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $tagValuesClient->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. + */ +class TagValuesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.resourcemanager.v3.TagValues'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'cloudresourcemanager.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', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + + private static $tagValueNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/tag_values_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/tag_values_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/tag_values_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/tag_values_rest_client_config.php', + ], + ], + ]; + } + + private static function getTagValueNameTemplate() + { + if (self::$tagValueNameTemplate == null) { + self::$tagValueNameTemplate = new PathTemplate('tagValues/{tag_value}'); + } + + return self::$tagValueNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'tagValue' => self::getTagValueNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a tag_value + * resource. + * + * @param string $tagValue + * + * @return string The formatted tag_value resource. + */ + public static function tagValueName($tagValue) + { + return self::getTagValueNameTemplate()->render([ + 'tag_value' => $tagValue, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - tagValue: tagValues/{tag_value} + * + * 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"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * 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 'cloudresourcemanager.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); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Creates a TagValue as a child of the specified TagKey. If a another + * request with the same parameters is sent while the original request is in + * process the second request will receive an error. A maximum of 1000 + * TagValues can exist under a TagKey at any given time. + * + * Sample code: + * ``` + * $tagValuesClient = new TagValuesClient(); + * try { + * $tagValue = new TagValue(); + * $operationResponse = $tagValuesClient->createTagValue($tagValue); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $tagValuesClient->createTagValue($tagValue); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $tagValuesClient->resumeOperation($operationName, 'createTagValue'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $tagValuesClient->close(); + * } + * ``` + * + * @param TagValue $tagValue Required. The TagValue to be created. Only fields `short_name`, + * `description`, and `parent` are considered during the creation request. + * @param array $optionalArgs { + * Optional. + * + * @type bool $validateOnly + * Optional. Set as true to perform the validations necessary for creating the + * resource, but not actually perform the action. + * @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\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createTagValue($tagValue, array $optionalArgs = []) + { + $request = new CreateTagValueRequest(); + $request->setTagValue($tagValue); + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + return $this->startOperationsCall('CreateTagValue', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a TagValue. The TagValue cannot have any bindings when it is + * deleted. + * + * Sample code: + * ``` + * $tagValuesClient = new TagValuesClient(); + * try { + * $formattedName = $tagValuesClient->tagValueName('[TAG_VALUE]'); + * $operationResponse = $tagValuesClient->deleteTagValue($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $tagValuesClient->deleteTagValue($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $tagValuesClient->resumeOperation($operationName, 'deleteTagValue'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $tagValuesClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name for TagValue to be deleted in the format + * tagValues/456. + * @param array $optionalArgs { + * Optional. + * + * @type bool $validateOnly + * Optional. Set as true to perform the validations necessary for deletion, + * but not actually perform the action. + * @type string $etag + * Optional. The etag known to the client for the expected state of the + * TagValue. This is to be used for optimistic concurrency. + * @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\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteTagValue($name, array $optionalArgs = []) + { + $request = new DeleteTagValueRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteTagValue', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets the access control policy for a TagValue. The returned policy may be + * empty if no such policy or resource exists. The `resource` field should + * be the TagValue's resource name. For example: `tagValues/1234`. + * The caller must have the + * `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on + * the identified TagValue to get the access control policy. + * + * Sample code: + * ``` + * $tagValuesClient = new TagValuesClient(); + * try { + * $resource = 'resource'; + * $response = $tagValuesClient->getIamPolicy($resource); + * } finally { + * $tagValuesClient->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(); + } + + /** + * Retrieves a TagValue by its namespaced name. + * This method will return `PERMISSION_DENIED` if the value does not exist + * or the user does not have permission to view it. + * + * Sample code: + * ``` + * $tagValuesClient = new TagValuesClient(); + * try { + * $formattedName = $tagValuesClient->tagValueName('[TAG_VALUE]'); + * $response = $tagValuesClient->getNamespacedTagValue($formattedName); + * } finally { + * $tagValuesClient->close(); + * } + * ``` + * + * @param string $name Required. A namespaced tag value name in the following format: + * + * `{parentId}/{tagKeyShort}/{tagValueShort}` + * + * Examples: + * - `42/foo/abc` for a value with short name "abc" under the key with short + * name "foo" under the organization with ID 42 + * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with + * short name "bar" under the project with ID "r2-d2" + * @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\ResourceManager\V3\TagValue + * + * @throws ApiException if the remote call fails + */ + public function getNamespacedTagValue($name, array $optionalArgs = []) + { + $request = new GetNamespacedTagValueRequest(); + $request->setName($name); + return $this->startCall('GetNamespacedTagValue', TagValue::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the + * value does not exist or the user does not have permission to view it. + * + * Sample code: + * ``` + * $tagValuesClient = new TagValuesClient(); + * try { + * $formattedName = $tagValuesClient->tagValueName('[TAG_VALUE]'); + * $response = $tagValuesClient->getTagValue($formattedName); + * } finally { + * $tagValuesClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name for TagValue to be fetched in the format + * `tagValues/456`. + * @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\ResourceManager\V3\TagValue + * + * @throws ApiException if the remote call fails + */ + public function getTagValue($name, array $optionalArgs = []) + { + $request = new GetTagValueRequest(); + $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('GetTagValue', TagValue::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists all TagValues for a specific TagKey. + * + * Sample code: + * ``` + * $tagValuesClient = new TagValuesClient(); + * try { + * $parent = 'parent'; + * // Iterate over pages of elements + * $pagedResponse = $tagValuesClient->listTagValues($parent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $tagValuesClient->listTagValues($parent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $tagValuesClient->close(); + * } + * ``` + * + * @param string $parent Required. + * @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 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 listTagValues($parent, array $optionalArgs = []) + { + $request = new ListTagValuesRequest(); + $request->setParent($parent); + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + return $this->getPagedListResponse('ListTagValues', $optionalArgs, ListTagValuesResponse::class, $request); + } + + /** + * Sets the access control policy on a TagValue, replacing any existing + * policy. The `resource` field should be the TagValue's resource name. + * For example: `tagValues/1234`. + * The caller must have `resourcemanager.tagValues.setIamPolicy` permission + * on the identified tagValue. + * + * Sample code: + * ``` + * $tagValuesClient = new TagValuesClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $tagValuesClient->setIamPolicy($resource, $policy); + * } finally { + * $tagValuesClient->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(); + } + + /** + * Returns permissions that a caller has on the specified TagValue. + * The `resource` field should be the TagValue's resource name. For example: + * `tagValues/1234`. + * + * There are no permissions required for making this API call. + * + * Sample code: + * ``` + * $tagValuesClient = new TagValuesClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $tagValuesClient->testIamPermissions($resource, $permissions); + * } finally { + * $tagValuesClient->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 the attributes of the TagValue resource. + * + * Sample code: + * ``` + * $tagValuesClient = new TagValuesClient(); + * try { + * $tagValue = new TagValue(); + * $operationResponse = $tagValuesClient->updateTagValue($tagValue); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $tagValuesClient->updateTagValue($tagValue); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $tagValuesClient->resumeOperation($operationName, 'updateTagValue'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $tagValuesClient->close(); + * } + * ``` + * + * @param TagValue $tagValue Required. The new definition of the TagValue. Only fields `description` and + * `etag` fields can be updated by this request. If the `etag` field is + * nonempty, it must match the `etag` field of the existing ControlGroup. + * Otherwise, `ABORTED` will be returned. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Fields to be updated. + * @type bool $validateOnly + * Optional. True to perform validations necessary for updating the resource, + * but not actually perform the action. + * @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\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateTagValue($tagValue, array $optionalArgs = []) + { + $request = new UpdateTagValueRequest(); + $requestParamHeaders = []; + $request->setTagValue($tagValue); + $requestParamHeaders['tag_value.name'] = $tagValue->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateTagValue', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/OrganizationsClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/OrganizationsClient.php new file mode 100644 index 000000000000..59e97e3989a2 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/OrganizationsClient.php @@ -0,0 +1,34 @@ + [ + 'google.cloud.resourcemanager.v3.Folders' => [ + 'CreateFolder' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateFolderMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteFolder' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteFolderMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'MoveFolder' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\MoveFolderMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UndeleteFolder' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UndeleteFolderMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateFolder' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UpdateFolderMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ListFolders' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getFolders', + ], + ], + 'SearchFolders' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getFolders', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_rest_client_config.php new file mode 100644 index 000000000000..207e25e6815d --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_rest_client_config.php @@ -0,0 +1,136 @@ + [ + 'google.cloud.resourcemanager.v3.Folders' => [ + 'CreateFolder' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/folders', + 'body' => 'folder', + ], + 'DeleteFolder' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=folders/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetFolder' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=folders/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=folders/*}:getIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'ListFolders' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/folders', + 'queryParams' => [ + 'parent', + ], + ], + 'MoveFolder' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=folders/*}:move', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SearchFolders' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/folders:search', + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=folders/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=folders/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UndeleteFolder' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=folders/*}:undelete', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateFolder' => [ + 'method' => 'patch', + 'uriTemplate' => '/v3/{folder.name=folders/*}', + 'body' => 'folder', + 'placeholders' => [ + 'folder.name' => [ + 'getters' => [ + 'getFolder', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_client_config.json new file mode 100644 index 000000000000..cd3f3bc9c021 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.Organizations": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "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": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetOrganization": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SearchOrganizations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_descriptor_config.php new file mode 100644 index 000000000000..517a2fee2f3a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_descriptor_config.php @@ -0,0 +1,18 @@ + [ + 'google.cloud.resourcemanager.v3.Organizations' => [ + 'SearchOrganizations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getOrganizations', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_rest_client_config.php new file mode 100644 index 000000000000..ac91964986fa --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_rest_client_config.php @@ -0,0 +1,73 @@ + [ + 'google.cloud.resourcemanager.v3.Organizations' => [ + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=organizations/*}:getIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetOrganization' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=organizations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SearchOrganizations' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/organizations:search', + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=organizations/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=organizations/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_client_config.json new file mode 100644 index 000000000000..bf38535bd8a5 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_client_config.json @@ -0,0 +1,99 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.Projects": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "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": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateProject": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteProject": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetProject": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListProjects": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "MoveProject": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SearchProjects": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UndeleteProject": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateProject": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_descriptor_config.php new file mode 100644 index 000000000000..343e1f75bb50 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_descriptor_config.php @@ -0,0 +1,78 @@ + [ + 'google.cloud.resourcemanager.v3.Projects' => [ + 'CreateProject' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateProjectMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteProject' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteProjectMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'MoveProject' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\MoveProjectMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UndeleteProject' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UndeleteProjectMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateProject' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UpdateProjectMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ListProjects' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getProjects', + ], + ], + 'SearchProjects' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getProjects', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_rest_client_config.php new file mode 100644 index 000000000000..0683b4473a2a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_rest_client_config.php @@ -0,0 +1,133 @@ + [ + 'google.cloud.resourcemanager.v3.Projects' => [ + 'CreateProject' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/projects', + 'body' => 'project', + ], + 'DeleteProject' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=projects/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=projects/*}:getIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetProject' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListProjects' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/projects', + 'queryParams' => [ + 'parent', + ], + ], + 'MoveProject' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*}:move', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SearchProjects' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/projects:search', + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=projects/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=projects/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UndeleteProject' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*}:undelete', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateProject' => [ + 'method' => 'patch', + 'uriTemplate' => '/v3/{project.name=projects/*}', + 'body' => 'project', + 'placeholders' => [ + 'project.name' => [ + 'getters' => [ + 'getProject', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_client_config.json new file mode 100644 index 000000000000..8f187c5e23a3 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.TagBindings": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "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": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateTagBinding": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteTagBinding": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListEffectiveTags": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListTagBindings": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_descriptor_config.php new file mode 100644 index 000000000000..d5e99aa90b6e --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_descriptor_config.php @@ -0,0 +1,48 @@ + [ + 'google.cloud.resourcemanager.v3.TagBindings' => [ + 'CreateTagBinding' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagBinding', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateTagBindingMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteTagBinding' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteTagBindingMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ListEffectiveTags' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEffectiveTags', + ], + ], + 'ListTagBindings' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTagBindings', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_rest_client_config.php new file mode 100644 index 000000000000..f7a37f80d839 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_rest_client_config.php @@ -0,0 +1,52 @@ + [ + 'google.cloud.resourcemanager.v3.TagBindings' => [ + 'CreateTagBinding' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/tagBindings', + 'body' => 'tag_binding', + ], + 'DeleteTagBinding' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=tagBindings/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListEffectiveTags' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/effectiveTags', + 'queryParams' => [ + 'parent', + ], + ], + 'ListTagBindings' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/tagBindings', + 'queryParams' => [ + 'parent', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_client_config.json new file mode 100644 index 000000000000..bf327d859db3 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_client_config.json @@ -0,0 +1,37 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.TagHolds": { + "retry_codes": { + "no_retry_codes": [] + }, + "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 + } + }, + "methods": { + "CreateTagHold": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteTagHold": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListTagHolds": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_descriptor_config.php new file mode 100644 index 000000000000..c7e386d4a935 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_descriptor_config.php @@ -0,0 +1,38 @@ + [ + 'google.cloud.resourcemanager.v3.TagHolds' => [ + 'CreateTagHold' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagHold', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateTagHoldMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteTagHold' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteTagHoldMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ListTagHolds' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTagHolds', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_rest_client_config.php new file mode 100644 index 000000000000..8f1a1fbafe66 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_rest_client_config.php @@ -0,0 +1,56 @@ + [ + 'google.cloud.resourcemanager.v3.TagHolds' => [ + 'CreateTagHold' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{parent=tagValues/*}/tagHolds', + 'body' => 'tag_hold', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteTagHold' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=tagValues/*/tagHolds/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListTagHolds' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{parent=tagValues/*}/tagHolds', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_client_config.json new file mode 100644 index 000000000000..75f389d694a4 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_client_config.json @@ -0,0 +1,89 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.TagKeys": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "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": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateTagKey": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteTagKey": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetNamespacedTagKey": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetTagKey": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTagKeys": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateTagKey": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_descriptor_config.php new file mode 100644 index 000000000000..337d4779f7ce --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_descriptor_config.php @@ -0,0 +1,48 @@ + [ + 'google.cloud.resourcemanager.v3.TagKeys' => [ + 'CreateTagKey' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagKey', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateTagKeyMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteTagKey' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagKey', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteTagKeyMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateTagKey' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagKey', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UpdateTagKeyMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ListTagKeys' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTagKeys', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_rest_client_config.php new file mode 100644 index 000000000000..969c16663c34 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_rest_client_config.php @@ -0,0 +1,112 @@ + [ + 'google.cloud.resourcemanager.v3.TagKeys' => [ + 'CreateTagKey' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/tagKeys', + 'body' => 'tag_key', + ], + 'DeleteTagKey' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=tagKeys/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=tagKeys/*}:getIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetNamespacedTagKey' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/tagKeys/namespaced', + 'queryParams' => [ + 'name', + ], + ], + 'GetTagKey' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=tagKeys/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListTagKeys' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/tagKeys', + 'queryParams' => [ + 'parent', + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=tagKeys/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=tagKeys/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateTagKey' => [ + 'method' => 'patch', + 'uriTemplate' => '/v3/{tag_key.name=tagKeys/*}', + 'body' => 'tag_key', + 'placeholders' => [ + 'tag_key.name' => [ + 'getters' => [ + 'getTagKey', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_client_config.json new file mode 100644 index 000000000000..f9fae4e4bfd0 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_client_config.json @@ -0,0 +1,89 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.TagValues": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "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": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateTagValue": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteTagValue": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetNamespacedTagValue": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetTagValue": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTagValues": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateTagValue": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_descriptor_config.php new file mode 100644 index 000000000000..706c5f124be6 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_descriptor_config.php @@ -0,0 +1,48 @@ + [ + 'google.cloud.resourcemanager.v3.TagValues' => [ + 'CreateTagValue' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagValue', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateTagValueMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteTagValue' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagValue', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteTagValueMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateTagValue' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagValue', + 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UpdateTagValueMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ListTagValues' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTagValues', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_rest_client_config.php new file mode 100644 index 000000000000..bacaedd72e94 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_rest_client_config.php @@ -0,0 +1,112 @@ + [ + 'google.cloud.resourcemanager.v3.TagValues' => [ + 'CreateTagValue' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/tagValues', + 'body' => 'tag_value', + ], + 'DeleteTagValue' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=tagValues/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=tagValues/*}:getIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetNamespacedTagValue' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/tagValues/namespaced', + 'queryParams' => [ + 'name', + ], + ], + 'GetTagValue' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=tagValues/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListTagValues' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/tagValues', + 'queryParams' => [ + 'parent', + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=tagValues/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{resource=tagValues/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateTagValue' => [ + 'method' => 'patch', + 'uriTemplate' => '/v3/{tag_value.name=tagValues/*}', + 'body' => 'tag_value', + 'placeholders' => [ + 'tag_value.name' => [ + 'getters' => [ + 'getTagValue', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=operations/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/FoldersClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/FoldersClientTest.php new file mode 100644 index 000000000000..ec2d97e32e3c --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/FoldersClientTest.php @@ -0,0 +1,1097 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return FoldersClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new FoldersClient($options); + } + + /** @test */ + public function createFolderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createFolderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Folder(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createFolderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $folder = new Folder(); + $folderParent = 'folderParent-1307212104'; + $folder->setParent($folderParent); + $response = $gapicClient->createFolder($folder); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Folders/CreateFolder', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFolder(); + $this->assertProtobufEquals($folder, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createFolderTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createFolderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createFolderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $folder = new Folder(); + $folderParent = 'folderParent-1307212104'; + $folder->setParent($folderParent); + $response = $gapicClient->createFolder($folder); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createFolderTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteFolderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteFolderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Folder(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteFolderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->folderName('[FOLDER]'); + $response = $gapicClient->deleteFolder($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Folders/DeleteFolder', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteFolderTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteFolderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteFolderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->folderName('[FOLDER]'); + $response = $gapicClient->deleteFolder($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteFolderTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getFolderTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Folder(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->folderName('[FOLDER]'); + $response = $gapicClient->getFolder($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.resourcemanager.v3.Folders/GetFolder', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFolderExceptionTest() + { + $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->folderName('[FOLDER]'); + try { + $gapicClient->getFolder($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.resourcemanager.v3.Folders/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 listFoldersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $foldersElement = new Folder(); + $folders = [ + $foldersElement, + ]; + $expectedResponse = new ListFoldersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setFolders($folders); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $response = $gapicClient->listFolders($parent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getFolders()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Folders/ListFolders', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listFoldersExceptionTest() + { + $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 + $parent = 'parent-995424086'; + try { + $gapicClient->listFolders($parent); + // 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 moveFolderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/moveFolderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Folder(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/moveFolderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->folderName('[FOLDER]'); + $destinationParent = 'destinationParent-1362053637'; + $response = $gapicClient->moveFolder($formattedName, $destinationParent); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Folders/MoveFolder', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getDestinationParent(); + $this->assertProtobufEquals($destinationParent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/moveFolderTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function moveFolderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/moveFolderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->folderName('[FOLDER]'); + $destinationParent = 'destinationParent-1362053637'; + $response = $gapicClient->moveFolder($formattedName, $destinationParent); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/moveFolderTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function searchFoldersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $foldersElement = new Folder(); + $folders = [ + $foldersElement, + ]; + $expectedResponse = new SearchFoldersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setFolders($folders); + $transport->addResponse($expectedResponse); + $response = $gapicClient->searchFolders(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getFolders()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Folders/SearchFolders', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchFoldersExceptionTest() + { + $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->searchFolders(); + // 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.resourcemanager.v3.Folders/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.resourcemanager.v3.Folders/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 undeleteFolderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeleteFolderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Folder(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/undeleteFolderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->folderName('[FOLDER]'); + $response = $gapicClient->undeleteFolder($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Folders/UndeleteFolder', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeleteFolderTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function undeleteFolderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeleteFolderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->folderName('[FOLDER]'); + $response = $gapicClient->undeleteFolder($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeleteFolderTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateFolderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateFolderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Folder(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateFolderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $folder = new Folder(); + $folderParent = 'folderParent-1307212104'; + $folder->setParent($folderParent); + $updateMask = new FieldMask(); + $response = $gapicClient->updateFolder($folder, $updateMask); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Folders/UpdateFolder', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFolder(); + $this->assertProtobufEquals($folder, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateFolderTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateFolderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateFolderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $folder = new Folder(); + $folderParent = 'folderParent-1307212104'; + $folder->setParent($folderParent); + $updateMask = new FieldMask(); + $response = $gapicClient->updateFolder($folder, $updateMask); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateFolderTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/OrganizationsClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/OrganizationsClientTest.php new file mode 100644 index 000000000000..b264ac604fdc --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/OrganizationsClientTest.php @@ -0,0 +1,382 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return OrganizationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new OrganizationsClient($options); + } + + /** @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.resourcemanager.v3.Organizations/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 getOrganizationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $directoryCustomerId = 'directoryCustomerId813284938'; + $etag = 'etag3123477'; + $expectedResponse = new Organization(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDirectoryCustomerId($directoryCustomerId); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->organizationName('[ORGANIZATION]'); + $response = $gapicClient->getOrganization($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.resourcemanager.v3.Organizations/GetOrganization', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getOrganizationExceptionTest() + { + $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->organizationName('[ORGANIZATION]'); + try { + $gapicClient->getOrganization($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 searchOrganizationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $organizationsElement = new Organization(); + $organizations = [ + $organizationsElement, + ]; + $expectedResponse = new SearchOrganizationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setOrganizations($organizations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->searchOrganizations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getOrganizations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Organizations/SearchOrganizations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchOrganizationsExceptionTest() + { + $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->searchOrganizations(); + // 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.resourcemanager.v3.Organizations/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.resourcemanager.v3.Organizations/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()); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/ProjectsClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/ProjectsClientTest.php new file mode 100644 index 000000000000..31e5fc471cfd --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/ProjectsClientTest.php @@ -0,0 +1,1096 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ProjectsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ProjectsClient($options); + } + + /** @test */ + public function createProjectTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $projectId = 'projectId-1969970175'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Project(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setProjectId($projectId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createProjectTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = new Project(); + $response = $gapicClient->createProject($project); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Projects/CreateProject', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createProjectTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createProjectExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $project = new Project(); + $response = $gapicClient->createProject($project); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createProjectTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteProjectTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $projectId = 'projectId-1969970175'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Project(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setProjectId($projectId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteProjectTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $response = $gapicClient->deleteProject($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Projects/DeleteProject', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProjectTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteProjectExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $response = $gapicClient->deleteProject($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProjectTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->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.resourcemanager.v3.Projects/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 getProjectTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $projectId = 'projectId-1969970175'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Project(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setProjectId($projectId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $response = $gapicClient->getProject($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.resourcemanager.v3.Projects/GetProject', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProjectExceptionTest() + { + $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->projectName('[PROJECT]'); + try { + $gapicClient->getProject($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 listProjectsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $projectsElement = new Project(); + $projects = [ + $projectsElement, + ]; + $expectedResponse = new ListProjectsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProjects($projects); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $response = $gapicClient->listProjects($parent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProjects()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Projects/ListProjects', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProjectsExceptionTest() + { + $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 + $parent = 'parent-995424086'; + try { + $gapicClient->listProjects($parent); + // 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 moveProjectTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/moveProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $projectId = 'projectId-1969970175'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Project(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setProjectId($projectId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/moveProjectTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $destinationParent = 'destinationParent-1362053637'; + $response = $gapicClient->moveProject($formattedName, $destinationParent); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Projects/MoveProject', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getDestinationParent(); + $this->assertProtobufEquals($destinationParent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/moveProjectTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function moveProjectExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/moveProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $destinationParent = 'destinationParent-1362053637'; + $response = $gapicClient->moveProject($formattedName, $destinationParent); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/moveProjectTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function searchProjectsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $projectsElement = new Project(); + $projects = [ + $projectsElement, + ]; + $expectedResponse = new SearchProjectsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProjects($projects); + $transport->addResponse($expectedResponse); + $response = $gapicClient->searchProjects(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProjects()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Projects/SearchProjects', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchProjectsExceptionTest() + { + $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->searchProjects(); + // 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.resourcemanager.v3.Projects/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.resourcemanager.v3.Projects/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 undeleteProjectTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeleteProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $projectId = 'projectId-1969970175'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Project(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setProjectId($projectId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/undeleteProjectTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $response = $gapicClient->undeleteProject($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Projects/UndeleteProject', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeleteProjectTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function undeleteProjectExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeleteProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $response = $gapicClient->undeleteProject($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeleteProjectTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateProjectTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $projectId = 'projectId-1969970175'; + $displayName = 'displayName1615086568'; + $etag = 'etag3123477'; + $expectedResponse = new Project(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setProjectId($projectId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateProjectTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = new Project(); + $response = $gapicClient->updateProject($project); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.Projects/UpdateProject', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateProjectTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateProjectExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateProjectTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $project = new Project(); + $response = $gapicClient->updateProject($project); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateProjectTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagBindingsClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagBindingsClientTest.php new file mode 100644 index 000000000000..40ef738f642f --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagBindingsClientTest.php @@ -0,0 +1,447 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TagBindingsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TagBindingsClient($options); + } + + /** @test */ + public function createTagBindingTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTagBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $tagValue = 'tagValue2092898444'; + $tagValueNamespacedName = 'tagValueNamespacedName1368345838'; + $expectedResponse = new TagBinding(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setTagValue($tagValue); + $expectedResponse->setTagValueNamespacedName($tagValueNamespacedName); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createTagBindingTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $tagBinding = new TagBinding(); + $response = $gapicClient->createTagBinding($tagBinding); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagBindings/CreateTagBinding', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getTagBinding(); + $this->assertProtobufEquals($tagBinding, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagBindingTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createTagBindingExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTagBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $tagBinding = new TagBinding(); + $response = $gapicClient->createTagBinding($tagBinding); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagBindingTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteTagBindingTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTagBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteTagBindingTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->tagBindingName('[TAG_BINDING]'); + $response = $gapicClient->deleteTagBinding($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagBindings/DeleteTagBinding', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTagBindingTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteTagBindingExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTagBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tagBindingName('[TAG_BINDING]'); + $response = $gapicClient->deleteTagBinding($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTagBindingTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function listEffectiveTagsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $effectiveTagsElement = new EffectiveTag(); + $effectiveTags = [ + $effectiveTagsElement, + ]; + $expectedResponse = new ListEffectiveTagsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setEffectiveTags($effectiveTags); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $response = $gapicClient->listEffectiveTags($parent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getEffectiveTags()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagBindings/ListEffectiveTags', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEffectiveTagsExceptionTest() + { + $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 + $parent = 'parent-995424086'; + try { + $gapicClient->listEffectiveTags($parent); + // 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 listTagBindingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tagBindingsElement = new TagBinding(); + $tagBindings = [ + $tagBindingsElement, + ]; + $expectedResponse = new ListTagBindingsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTagBindings($tagBindings); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $response = $gapicClient->listTagBindings($parent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTagBindings()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagBindings/ListTagBindings', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTagBindingsExceptionTest() + { + $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 + $parent = 'parent-995424086'; + try { + $gapicClient->listTagBindings($parent); + // 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/ResourceManager/v3/tests/Unit/V3/TagHoldsClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagHoldsClientTest.php new file mode 100644 index 000000000000..08bbdefed9c3 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagHoldsClientTest.php @@ -0,0 +1,385 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TagHoldsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TagHoldsClient($options); + } + + /** @test */ + public function createTagHoldTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTagHoldTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $holder = 'holder-1211707988'; + $origin = 'origin-1008619738'; + $helpLink = 'helpLink1297152568'; + $expectedResponse = new TagHold(); + $expectedResponse->setName($name); + $expectedResponse->setHolder($holder); + $expectedResponse->setOrigin($origin); + $expectedResponse->setHelpLink($helpLink); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createTagHoldTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->tagValueName('[TAG_VALUE]'); + $tagHold = new TagHold(); + $tagHoldHolder = 'tagHoldHolder-501201275'; + $tagHold->setHolder($tagHoldHolder); + $response = $gapicClient->createTagHold($formattedParent, $tagHold); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagHolds/CreateTagHold', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getTagHold(); + $this->assertProtobufEquals($tagHold, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagHoldTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createTagHoldExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTagHoldTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->tagValueName('[TAG_VALUE]'); + $tagHold = new TagHold(); + $tagHoldHolder = 'tagHoldHolder-501201275'; + $tagHold->setHolder($tagHoldHolder); + $response = $gapicClient->createTagHold($formattedParent, $tagHold); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagHoldTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteTagHoldTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTagHoldTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteTagHoldTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->tagHoldName('[TAG_VALUE]', '[TAG_HOLD]'); + $response = $gapicClient->deleteTagHold($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagHolds/DeleteTagHold', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTagHoldTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteTagHoldExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTagHoldTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tagHoldName('[TAG_VALUE]', '[TAG_HOLD]'); + $response = $gapicClient->deleteTagHold($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTagHoldTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function listTagHoldsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tagHoldsElement = new TagHold(); + $tagHolds = [ + $tagHoldsElement, + ]; + $expectedResponse = new ListTagHoldsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTagHolds($tagHolds); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->tagValueName('[TAG_VALUE]'); + $response = $gapicClient->listTagHolds($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTagHolds()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagHolds/ListTagHolds', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTagHoldsExceptionTest() + { + $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->tagValueName('[TAG_VALUE]'); + try { + $gapicClient->listTagHolds($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()); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagKeysClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagKeysClientTest.php new file mode 100644 index 000000000000..52f59fba05d4 --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagKeysClientTest.php @@ -0,0 +1,861 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TagKeysClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TagKeysClient($options); + } + + /** @test */ + public function createTagKeyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTagKeyTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagKey(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createTagKeyTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $tagKey = new TagKey(); + $tagKeyShortName = 'tagKeyShortName-1212707262'; + $tagKey->setShortName($tagKeyShortName); + $response = $gapicClient->createTagKey($tagKey); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/CreateTagKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getTagKey(); + $this->assertProtobufEquals($tagKey, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagKeyTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createTagKeyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTagKeyTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $tagKey = new TagKey(); + $tagKeyShortName = 'tagKeyShortName-1212707262'; + $tagKey->setShortName($tagKeyShortName); + $response = $gapicClient->createTagKey($tagKey); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagKeyTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteTagKeyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTagKeyTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new TagKey(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteTagKeyTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->tagKeyName('[TAG_KEY]'); + $response = $gapicClient->deleteTagKey($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/DeleteTagKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTagKeyTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteTagKeyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTagKeyTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tagKeyName('[TAG_KEY]'); + $response = $gapicClient->deleteTagKey($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTagKeyTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->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.resourcemanager.v3.TagKeys/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 getNamespacedTagKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagKey(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tagKeyName('[TAG_KEY]'); + $response = $gapicClient->getNamespacedTagKey($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.resourcemanager.v3.TagKeys/GetNamespacedTagKey', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNamespacedTagKeyExceptionTest() + { + $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->tagKeyName('[TAG_KEY]'); + try { + $gapicClient->getNamespacedTagKey($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 getTagKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagKey(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tagKeyName('[TAG_KEY]'); + $response = $gapicClient->getTagKey($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.resourcemanager.v3.TagKeys/GetTagKey', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTagKeyExceptionTest() + { + $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->tagKeyName('[TAG_KEY]'); + try { + $gapicClient->getTagKey($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 listTagKeysTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tagKeysElement = new TagKey(); + $tagKeys = [ + $tagKeysElement, + ]; + $expectedResponse = new ListTagKeysResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTagKeys($tagKeys); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $response = $gapicClient->listTagKeys($parent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTagKeys()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/ListTagKeys', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTagKeysExceptionTest() + { + $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 + $parent = 'parent-995424086'; + try { + $gapicClient->listTagKeys($parent); + // 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.resourcemanager.v3.TagKeys/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.resourcemanager.v3.TagKeys/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 updateTagKeyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateTagKeyTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagKey(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateTagKeyTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $tagKey = new TagKey(); + $tagKeyShortName = 'tagKeyShortName-1212707262'; + $tagKey->setShortName($tagKeyShortName); + $response = $gapicClient->updateTagKey($tagKey); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/UpdateTagKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getTagKey(); + $this->assertProtobufEquals($tagKey, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTagKeyTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateTagKeyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateTagKeyTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $tagKey = new TagKey(); + $tagKeyShortName = 'tagKeyShortName-1212707262'; + $tagKey->setShortName($tagKeyShortName); + $response = $gapicClient->updateTagKey($tagKey); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTagKeyTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagValuesClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagValuesClientTest.php new file mode 100644 index 000000000000..2bd2be1f099a --- /dev/null +++ b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagValuesClientTest.php @@ -0,0 +1,861 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TagValuesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TagValuesClient($options); + } + + /** @test */ + public function createTagValueTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTagValueTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagValue(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createTagValueTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $tagValue = new TagValue(); + $tagValueShortName = 'tagValueShortName397125872'; + $tagValue->setShortName($tagValueShortName); + $response = $gapicClient->createTagValue($tagValue); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/CreateTagValue', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getTagValue(); + $this->assertProtobufEquals($tagValue, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagValueTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createTagValueExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTagValueTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $tagValue = new TagValue(); + $tagValueShortName = 'tagValueShortName397125872'; + $tagValue->setShortName($tagValueShortName); + $response = $gapicClient->createTagValue($tagValue); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTagValueTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteTagValueTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTagValueTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new TagValue(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteTagValueTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->tagValueName('[TAG_VALUE]'); + $response = $gapicClient->deleteTagValue($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/DeleteTagValue', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTagValueTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteTagValueExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTagValueTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->tagValueName('[TAG_VALUE]'); + $response = $gapicClient->deleteTagValue($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTagValueTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->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.resourcemanager.v3.TagValues/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 getNamespacedTagValueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagValue(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tagValueName('[TAG_VALUE]'); + $response = $gapicClient->getNamespacedTagValue($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.resourcemanager.v3.TagValues/GetNamespacedTagValue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNamespacedTagValueExceptionTest() + { + $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->tagValueName('[TAG_VALUE]'); + try { + $gapicClient->getNamespacedTagValue($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 getTagValueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagValue(); + $expectedResponse->setName($name2); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->tagValueName('[TAG_VALUE]'); + $response = $gapicClient->getTagValue($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.resourcemanager.v3.TagValues/GetTagValue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTagValueExceptionTest() + { + $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->tagValueName('[TAG_VALUE]'); + try { + $gapicClient->getTagValue($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 listTagValuesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tagValuesElement = new TagValue(); + $tagValues = [ + $tagValuesElement, + ]; + $expectedResponse = new ListTagValuesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTagValues($tagValues); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $response = $gapicClient->listTagValues($parent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTagValues()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/ListTagValues', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTagValuesExceptionTest() + { + $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 + $parent = 'parent-995424086'; + try { + $gapicClient->listTagValues($parent); + // 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.resourcemanager.v3.TagValues/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.resourcemanager.v3.TagValues/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 updateTagValueTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateTagValueTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $parent = 'parent-995424086'; + $shortName = 'shortName1565793390'; + $namespacedName = 'namespacedName1945728673'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new TagValue(); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setShortName($shortName); + $expectedResponse->setNamespacedName($namespacedName); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateTagValueTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $tagValue = new TagValue(); + $tagValueShortName = 'tagValueShortName397125872'; + $tagValue->setShortName($tagValueShortName); + $response = $gapicClient->updateTagValue($tagValue); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/UpdateTagValue', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getTagValue(); + $this->assertProtobufEquals($tagValue, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTagValueTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateTagValueExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateTagValueTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $tagValue = new TagValue(); + $tagValueShortName = 'tagValueShortName397125872'; + $tagValue->setShortName($tagValueShortName); + $response = $gapicClient->updateTagValue($tagValue); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTagValueTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} From 3c3d9647ae908b7eba3c4ab8fc947b525dbc393e Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 4 May 2023 05:01:50 +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 --- .../V3/TagKeysClient/list_tag_keys.php | 5 +- ResourceManager/src/V3/EffectiveTag.php | 68 +- .../src/V3/Gapic/TagKeysGapicClient.php | 5 +- ResourceManager/src/V3/ListTagKeysRequest.php | 20 +- ResourceManager/src/V3/Purpose.php | 14 +- ResourceManager/src/V3/TagKey.php | 28 +- ResourceManager/src/V3/TagValue.php | 32 +- .../Cloud/Resourcemanager/V3/Folders.php | Bin 5416 -> 0 bytes .../Resourcemanager/V3/Organizations.php | Bin 3389 -> 0 bytes .../Cloud/Resourcemanager/V3/Projects.php | Bin 5620 -> 0 bytes .../Cloud/Resourcemanager/V3/TagBindings.php | 81 -- .../Cloud/Resourcemanager/V3/TagHolds.php | 66 - .../Cloud/Resourcemanager/V3/TagKeys.php | Bin 4764 -> 0 bytes .../Cloud/Resourcemanager/V3/TagValues.php | 90 -- .../V3/CreateFolderMetadata.php | 105 -- .../V3/CreateFolderRequest.php | 81 -- .../V3/CreateProjectMetadata.php | 155 --- .../V3/CreateProjectRequest.php | 103 -- .../V3/CreateTagBindingMetadata.php | 33 - .../V3/CreateTagBindingRequest.php | 115 -- .../V3/CreateTagHoldMetadata.php | 35 - .../V3/CreateTagHoldRequest.php | 153 --- .../V3/CreateTagKeyMetadata.php | 33 - .../V3/CreateTagKeyRequest.php | 119 -- .../V3/CreateTagValueMetadata.php | 33 - .../V3/CreateTagValueRequest.php | 119 -- .../V3/DeleteFolderMetadata.php | 34 - .../V3/DeleteFolderRequest.php | 71 - .../V3/DeleteOrganizationMetadata.php | 34 - .../V3/DeleteProjectMetadata.php | 34 - .../V3/DeleteProjectRequest.php | 68 - .../V3/DeleteTagBindingMetadata.php | 33 - .../V3/DeleteTagBindingRequest.php | 75 -- .../V3/DeleteTagHoldMetadata.php | 35 - .../V3/DeleteTagHoldRequest.php | 109 -- .../V3/DeleteTagKeyMetadata.php | 33 - .../V3/DeleteTagKeyRequest.php | 151 --- .../V3/DeleteTagValueMetadata.php | 33 - .../V3/DeleteTagValueRequest.php | 147 --- .../Cloud/ResourceManager/V3/EffectiveTag.php | 289 ----- .../Cloud/ResourceManager/V3/Folder.php | 392 ------ .../Cloud/ResourceManager/V3/Folder/State.php | 64 - .../Cloud/ResourceManager/V3/Folder_State.php | 16 - .../ResourceManager/V3/FoldersGrpcClient.php | 307 ----- .../ResourceManager/V3/GetFolderRequest.php | 71 - .../V3/GetNamespacedTagKeyRequest.php | 79 -- .../V3/GetNamespacedTagValueRequest.php | 91 -- .../V3/GetOrganizationRequest.php | 76 -- .../ResourceManager/V3/GetProjectRequest.php | 69 - .../ResourceManager/V3/GetTagKeyRequest.php | 71 - .../ResourceManager/V3/GetTagValueRequest.php | 71 - .../V3/ListEffectiveTagsRequest.php | 155 --- .../V3/ListEffectiveTagsResponse.php | 129 -- .../ResourceManager/V3/ListFoldersRequest.php | 213 --- .../V3/ListFoldersResponse.php | 109 -- .../V3/ListProjectsRequest.php | 207 --- .../V3/ListProjectsResponse.php | 136 -- .../V3/ListTagBindingsRequest.php | 155 --- .../V3/ListTagBindingsResponse.php | 129 -- .../V3/ListTagHoldsRequest.php | 221 ---- .../V3/ListTagHoldsResponse.php | 129 -- .../ResourceManager/V3/ListTagKeysRequest.php | 155 --- .../V3/ListTagKeysResponse.php | 105 -- .../V3/ListTagValuesRequest.php | 149 --- .../V3/ListTagValuesResponse.php | 113 -- .../ResourceManager/V3/MoveFolderMetadata.php | 135 -- .../ResourceManager/V3/MoveFolderRequest.php | 113 -- .../V3/MoveProjectMetadata.php | 34 - .../ResourceManager/V3/MoveProjectRequest.php | 103 -- .../Cloud/ResourceManager/V3/Organization.php | 372 ------ .../ResourceManager/V3/Organization/State.php | 64 - .../ResourceManager/V3/Organization_State.php | 16 - .../V3/OrganizationsGrpcClient.php | 130 -- .../Cloud/ResourceManager/V3/Project.php | 489 ------- .../ResourceManager/V3/Project/State.php | 70 - .../ResourceManager/V3/Project_State.php | 16 - .../ResourceManager/V3/ProjectsGrpcClient.php | 325 ----- .../Cloud/ResourceManager/V3/Purpose.php | 66 - .../V3/SearchFoldersRequest.php | 247 ---- .../V3/SearchFoldersResponse.php | 109 -- .../V3/SearchOrganizationsRequest.php | 203 --- .../V3/SearchOrganizationsResponse.php | 121 -- .../V3/SearchProjectsRequest.php | 257 ---- .../V3/SearchProjectsResponse.php | 138 -- .../Cloud/ResourceManager/V3/TagBinding.php | 207 --- .../V3/TagBindingsGrpcClient.php | 101 -- .../Cloud/ResourceManager/V3/TagHold.php | 256 ---- .../ResourceManager/V3/TagHoldsGrpcClient.php | 85 -- .../Cloud/ResourceManager/V3/TagKey.php | 477 ------- .../ResourceManager/V3/TagKeysGrpcClient.php | 190 --- .../Cloud/ResourceManager/V3/TagValue.php | 374 ------ .../V3/TagValuesGrpcClient.php | 190 --- .../V3/UndeleteFolderMetadata.php | 34 - .../V3/UndeleteFolderRequest.php | 71 - .../V3/UndeleteOrganizationMetadata.php | 34 - .../V3/UndeleteProjectMetadata.php | 34 - .../V3/UndeleteProjectRequest.php | 73 -- .../V3/UpdateFolderMetadata.php | 34 - .../V3/UpdateFolderRequest.php | 135 -- .../V3/UpdateProjectMetadata.php | 34 - .../V3/UpdateProjectRequest.php | 126 -- .../V3/UpdateTagKeyMetadata.php | 33 - .../V3/UpdateTagKeyRequest.php | 179 --- .../V3/UpdateTagValueMetadata.php | 33 - .../V3/UpdateTagValueRequest.php | 171 --- .../V3/FoldersClient/create_folder.php | 109 -- .../V3/FoldersClient/delete_folder.php | 89 -- .../samples/V3/FoldersClient/get_folder.php | 71 - .../V3/FoldersClient/get_iam_policy.php | 70 - .../samples/V3/FoldersClient/list_folders.php | 84 -- .../samples/V3/FoldersClient/move_folder.php | 99 -- .../V3/FoldersClient/search_folders.php | 63 - .../V3/FoldersClient/set_iam_policy.php | 73 -- .../V3/FoldersClient/test_iam_permissions.php | 78 -- .../V3/FoldersClient/undelete_folder.php | 89 -- .../V3/FoldersClient/update_folder.php | 101 -- .../V3/OrganizationsClient/get_iam_policy.php | 71 - .../OrganizationsClient/get_organization.php | 68 - .../search_organizations.php | 64 - .../V3/OrganizationsClient/set_iam_policy.php | 74 -- .../test_iam_permissions.php | 78 -- .../V3/ProjectsClient/create_project.php | 72 -- .../V3/ProjectsClient/delete_project.php | 110 -- .../V3/ProjectsClient/get_iam_policy.php | 68 - .../samples/V3/ProjectsClient/get_project.php | 70 - .../V3/ProjectsClient/list_projects.php | 80 -- .../V3/ProjectsClient/move_project.php | 95 -- .../V3/ProjectsClient/search_projects.php | 67 - .../V3/ProjectsClient/set_iam_policy.php | 109 -- .../ProjectsClient/test_iam_permissions.php | 75 -- .../V3/ProjectsClient/undelete_project.php | 88 -- .../V3/ProjectsClient/update_project.php | 73 -- .../TagBindingsClient/create_tag_binding.php | 68 - .../TagBindingsClient/delete_tag_binding.php | 77 -- .../TagBindingsClient/list_effective_tags.php | 73 -- .../TagBindingsClient/list_tag_bindings.php | 76 -- .../V3/TagHoldsClient/create_tag_hold.php | 88 -- .../V3/TagHoldsClient/delete_tag_hold.php | 76 -- .../V3/TagHoldsClient/list_tag_holds.php | 72 -- .../V3/TagKeysClient/create_tag_key.php | 89 -- .../V3/TagKeysClient/delete_tag_key.php | 81 -- .../V3/TagKeysClient/get_iam_policy.php | 71 - .../TagKeysClient/get_namespaced_tag_key.php | 71 - .../samples/V3/TagKeysClient/get_tag_key.php | 68 - .../V3/TagKeysClient/list_tag_keys.php | 72 -- .../V3/TagKeysClient/set_iam_policy.php | 73 -- .../V3/TagKeysClient/test_iam_permissions.php | 78 -- .../V3/TagKeysClient/update_tag_key.php | 86 -- .../V3/TagValuesClient/create_tag_value.php | 89 -- .../V3/TagValuesClient/delete_tag_value.php | 80 -- .../V3/TagValuesClient/get_iam_policy.php | 71 - .../get_namespaced_tag_value.php | 76 -- .../V3/TagValuesClient/get_tag_value.php | 68 - .../V3/TagValuesClient/list_tag_values.php | 70 - .../V3/TagValuesClient/set_iam_policy.php | 73 -- .../TagValuesClient/test_iam_permissions.php | 78 -- .../V3/TagValuesClient/update_tag_value.php | 86 -- .../v3/src/V3/FoldersClient.php | 34 - .../v3/src/V3/Gapic/FoldersGapicClient.php | 1119 ---------------- .../src/V3/Gapic/OrganizationsGapicClient.php | 544 -------- .../v3/src/V3/Gapic/ProjectsGapicClient.php | 1139 ----------------- .../src/V3/Gapic/TagBindingsGapicClient.php | 574 --------- .../v3/src/V3/Gapic/TagHoldsGapicClient.php | 569 -------- .../v3/src/V3/Gapic/TagKeysGapicClient.php | 856 ------------- .../v3/src/V3/Gapic/TagValuesGapicClient.php | 856 ------------- .../v3/src/V3/OrganizationsClient.php | 34 - .../v3/src/V3/ProjectsClient.php | 34 - .../v3/src/V3/TagBindingsClient.php | 34 - .../v3/src/V3/TagHoldsClient.php | 34 - .../v3/src/V3/TagKeysClient.php | 34 - .../v3/src/V3/TagValuesClient.php | 34 - .../v3/src/V3/gapic_metadata.json | 332 ----- .../V3/resources/folders_client_config.json | 99 -- .../resources/folders_descriptor_config.php | 78 -- .../resources/folders_rest_client_config.php | 136 -- .../organizations_client_config.json | 69 - .../organizations_descriptor_config.php | 18 - .../organizations_rest_client_config.php | 73 -- .../V3/resources/projects_client_config.json | 99 -- .../resources/projects_descriptor_config.php | 78 -- .../resources/projects_rest_client_config.php | 133 -- .../resources/tag_bindings_client_config.json | 64 - .../tag_bindings_descriptor_config.php | 48 - .../tag_bindings_rest_client_config.php | 52 - .../V3/resources/tag_holds_client_config.json | 37 - .../resources/tag_holds_descriptor_config.php | 38 - .../tag_holds_rest_client_config.php | 56 - .../V3/resources/tag_keys_client_config.json | 89 -- .../resources/tag_keys_descriptor_config.php | 48 - .../resources/tag_keys_rest_client_config.php | 112 -- .../resources/tag_values_client_config.json | 89 -- .../tag_values_descriptor_config.php | 48 - .../tag_values_rest_client_config.php | 112 -- .../v3/tests/Unit/V3/FoldersClientTest.php | 1097 ---------------- .../tests/Unit/V3/OrganizationsClientTest.php | 382 ------ .../v3/tests/Unit/V3/ProjectsClientTest.php | 1096 ---------------- .../tests/Unit/V3/TagBindingsClientTest.php | 447 ------- .../v3/tests/Unit/V3/TagHoldsClientTest.php | 385 ------ .../v3/tests/Unit/V3/TagKeysClientTest.php | 861 ------------- .../v3/tests/Unit/V3/TagValuesClientTest.php | 861 ------------- 200 files changed, 102 insertions(+), 28858 deletions(-) delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Folders.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Organizations.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Projects.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagBindings.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagHolds.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagKeys.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagValues.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteOrganizationMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/EffectiveTag.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder/State.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder_State.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/FoldersGrpcClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetFolderRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagKeyRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagValueRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetOrganizationRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetProjectRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagKeyRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagValueRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization/State.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization_State.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/OrganizationsGrpcClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project/State.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project_State.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ProjectsGrpcClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Purpose.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsResponse.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBinding.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBindingsGrpcClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHold.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHoldsGrpcClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKey.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKeysGrpcClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValue.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValuesGrpcClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteOrganizationMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueMetadata.php delete mode 100644 owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueRequest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/create_folder.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/delete_folder.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_folder.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/list_folders.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/move_folder.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/search_folders.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/set_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/undelete_folder.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/update_folder.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_organization.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/search_organizations.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/set_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/create_project.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/delete_project.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_project.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/list_projects.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/move_project.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/search_projects.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/set_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/undelete_project.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/update_project.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/create_tag_binding.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/delete_tag_binding.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_effective_tags.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_tag_bindings.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/create_tag_hold.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/delete_tag_hold.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/list_tag_holds.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/create_tag_key.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/delete_tag_key.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_namespaced_tag_key.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_tag_key.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/list_tag_keys.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/set_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/update_tag_key.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/create_tag_value.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/delete_tag_value.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_namespaced_tag_value.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_tag_value.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/list_tag_values.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/set_iam_policy.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/update_tag_value.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/FoldersClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Gapic/FoldersGapicClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Gapic/OrganizationsGapicClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Gapic/ProjectsGapicClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagBindingsGapicClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagHoldsGapicClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagKeysGapicClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagValuesGapicClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/OrganizationsClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/ProjectsClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/TagBindingsClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/TagHoldsClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/TagKeysClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/TagValuesClient.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/gapic_metadata.json delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_client_config.json delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_descriptor_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_rest_client_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_client_config.json delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_descriptor_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_rest_client_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_client_config.json delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_descriptor_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_rest_client_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_client_config.json delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_descriptor_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_rest_client_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_client_config.json delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_descriptor_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_rest_client_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_client_config.json delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_descriptor_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_rest_client_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_client_config.json delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_descriptor_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_rest_client_config.php delete mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/FoldersClientTest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/OrganizationsClientTest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/ProjectsClientTest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagBindingsClientTest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagHoldsClientTest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagKeysClientTest.php delete mode 100644 owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagValuesClientTest.php diff --git a/ResourceManager/samples/V3/TagKeysClient/list_tag_keys.php b/ResourceManager/samples/V3/TagKeysClient/list_tag_keys.php index 5ea640560f25..eeca46427dca 100644 --- a/ResourceManager/samples/V3/TagKeysClient/list_tag_keys.php +++ b/ResourceManager/samples/V3/TagKeysClient/list_tag_keys.php @@ -31,8 +31,9 @@ /** * Lists all TagKeys for a parent resource. * - * @param string $parent The resource name of the new TagKey's parent. - * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * @param string $parent The resource name of the TagKey's parent. + * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + * `projects/{project_number}` */ function list_tag_keys_sample(string $parent): void { diff --git a/ResourceManager/src/V3/EffectiveTag.php b/ResourceManager/src/V3/EffectiveTag.php index 585d05d568f7..060cf5f3a392 100644 --- a/ResourceManager/src/V3/EffectiveTag.php +++ b/ResourceManager/src/V3/EffectiveTag.php @@ -26,9 +26,10 @@ class EffectiveTag extends \Google\Protobuf\Internal\Message */ private $tag_value = ''; /** - * Namespaced name of the TagValue. Now only supported in the format - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}`. - * Other formats will be supported when we add non-org parented tags. + * The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. * * Generated from protobuf field string namespaced_tag_value = 2; */ @@ -41,16 +42,18 @@ class EffectiveTag extends \Google\Protobuf\Internal\Message */ private $tag_key = ''; /** - * The namespaced_name of the TagKey. Now only supported in the format of - * `{organization_id}/{tag_key_short_name}`. Other formats will be - * supported when we add non-org parented tags. + * The namespaced name of the TagKey. Can be in the form + * `{organization_id}/{tag_key_short_name}` or + * `{project_id}/{tag_key_short_name}` or + * `{project_number}/{tag_key_short_name}`. * * Generated from protobuf field string namespaced_tag_key = 4; */ private $namespaced_tag_key = ''; /** * The parent name of the tag key. - * Must be in the format `organizations/{organization_id}`. + * Must be in the format `organizations/{organization_id}` or + * `projects/{project_number}` * * Generated from protobuf field string tag_key_parent_name = 6; */ @@ -74,19 +77,22 @@ class EffectiveTag extends \Google\Protobuf\Internal\Message * @type string $tag_value * Resource name for TagValue in the format `tagValues/456`. * @type string $namespaced_tag_value - * Namespaced name of the TagValue. Now only supported in the format - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}`. - * Other formats will be supported when we add non-org parented tags. + * The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. * @type string $tag_key * The name of the TagKey, in the format `tagKeys/{id}`, such as * `tagKeys/123`. * @type string $namespaced_tag_key - * The namespaced_name of the TagKey. Now only supported in the format of - * `{organization_id}/{tag_key_short_name}`. Other formats will be - * supported when we add non-org parented tags. + * The namespaced name of the TagKey. Can be in the form + * `{organization_id}/{tag_key_short_name}` or + * `{project_id}/{tag_key_short_name}` or + * `{project_number}/{tag_key_short_name}`. * @type string $tag_key_parent_name * The parent name of the tag key. - * Must be in the format `organizations/{organization_id}`. + * Must be in the format `organizations/{organization_id}` or + * `projects/{project_number}` * @type bool $inherited * Indicates the inheritance status of a tag value * attached to the given resource. If the tag value is inherited from one of @@ -126,9 +132,10 @@ public function setTagValue($var) } /** - * Namespaced name of the TagValue. Now only supported in the format - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}`. - * Other formats will be supported when we add non-org parented tags. + * The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. * * Generated from protobuf field string namespaced_tag_value = 2; * @return string @@ -139,9 +146,10 @@ public function getNamespacedTagValue() } /** - * Namespaced name of the TagValue. Now only supported in the format - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}`. - * Other formats will be supported when we add non-org parented tags. + * The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. * * Generated from protobuf field string namespaced_tag_value = 2; * @param string $var @@ -184,9 +192,10 @@ public function setTagKey($var) } /** - * The namespaced_name of the TagKey. Now only supported in the format of - * `{organization_id}/{tag_key_short_name}`. Other formats will be - * supported when we add non-org parented tags. + * The namespaced name of the TagKey. Can be in the form + * `{organization_id}/{tag_key_short_name}` or + * `{project_id}/{tag_key_short_name}` or + * `{project_number}/{tag_key_short_name}`. * * Generated from protobuf field string namespaced_tag_key = 4; * @return string @@ -197,9 +206,10 @@ public function getNamespacedTagKey() } /** - * The namespaced_name of the TagKey. Now only supported in the format of - * `{organization_id}/{tag_key_short_name}`. Other formats will be - * supported when we add non-org parented tags. + * The namespaced name of the TagKey. Can be in the form + * `{organization_id}/{tag_key_short_name}` or + * `{project_id}/{tag_key_short_name}` or + * `{project_number}/{tag_key_short_name}`. * * Generated from protobuf field string namespaced_tag_key = 4; * @param string $var @@ -215,7 +225,8 @@ public function setNamespacedTagKey($var) /** * The parent name of the tag key. - * Must be in the format `organizations/{organization_id}`. + * Must be in the format `organizations/{organization_id}` or + * `projects/{project_number}` * * Generated from protobuf field string tag_key_parent_name = 6; * @return string @@ -227,7 +238,8 @@ public function getTagKeyParentName() /** * The parent name of the tag key. - * Must be in the format `organizations/{organization_id}`. + * Must be in the format `organizations/{organization_id}` or + * `projects/{project_number}` * * Generated from protobuf field string tag_key_parent_name = 6; * @param string $var diff --git a/ResourceManager/src/V3/Gapic/TagKeysGapicClient.php b/ResourceManager/src/V3/Gapic/TagKeysGapicClient.php index 14d2af87e415..81fad5778a3f 100644 --- a/ResourceManager/src/V3/Gapic/TagKeysGapicClient.php +++ b/ResourceManager/src/V3/Gapic/TagKeysGapicClient.php @@ -622,8 +622,9 @@ public function getTagKey($name, array $optionalArgs = []) * } * ``` * - * @param string $parent Required. The resource name of the new TagKey's parent. - * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * @param string $parent Required. The resource name of the TagKey's parent. + * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + * `projects/{project_number}` * @param array $optionalArgs { * Optional. * diff --git a/ResourceManager/src/V3/ListTagKeysRequest.php b/ResourceManager/src/V3/ListTagKeysRequest.php index 522d6e1e562e..470865a00cf7 100644 --- a/ResourceManager/src/V3/ListTagKeysRequest.php +++ b/ResourceManager/src/V3/ListTagKeysRequest.php @@ -16,8 +16,9 @@ class ListTagKeysRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The resource name of the new TagKey's parent. - * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * Required. The resource name of the TagKey's parent. + * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + * `projects/{project_number}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -45,8 +46,9 @@ class ListTagKeysRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $parent - * Required. The resource name of the new TagKey's parent. - * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * Required. The resource name of the TagKey's parent. + * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + * `projects/{project_number}` * @type int $page_size * Optional. The maximum number of TagKeys to return in the response. The * server allows a maximum of 300 TagKeys to return. If unspecified, the @@ -62,8 +64,9 @@ public function __construct($data = NULL) { } /** - * Required. The resource name of the new TagKey's parent. - * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * Required. The resource name of the TagKey's parent. + * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + * `projects/{project_number}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -74,8 +77,9 @@ public function getParent() } /** - * Required. The resource name of the new TagKey's parent. - * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * Required. The resource name of the TagKey's parent. + * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + * `projects/{project_number}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/ResourceManager/src/V3/Purpose.php b/ResourceManager/src/V3/Purpose.php index 726136dd8371..77092359f1d1 100644 --- a/ResourceManager/src/V3/Purpose.php +++ b/ResourceManager/src/V3/Purpose.php @@ -23,14 +23,16 @@ class Purpose const PURPOSE_UNSPECIFIED = 0; /** * Purpose for Compute Engine firewalls. - * A corresponding purpose_data should be set for the network the tag is - * intended for. The key should be 'network' and the value should be in + * A corresponding `purpose_data` should be set for the network the tag is + * intended for. The key should be `network` and the value should be in * either of these two formats: - * -https://www.googleapis.com/compute/{compute_version}/projects/{project_id}/global/networks/{network_id} - * -{project_id}/{network_name} + * - + * `https://www.googleapis.com/compute/{compute_version}/projects/{project_id}/global/networks/{network_id}` + * - `{project_id}/{network_name}` * Examples: - * -https://www.googleapis.com/compute/staging_v1/projects/fail-closed-load-testing/global/networks/6992953698831725600 - * -fail-closed-load-testing/load-testing-network + * - + * `https://www.googleapis.com/compute/staging_v1/projects/fail-closed-load-testing/global/networks/6992953698831725600` + * - `fail-closed-load-testing/load-testing-network` * * Generated from protobuf enum GCE_FIREWALL = 1; */ diff --git a/ResourceManager/src/V3/TagKey.php b/ResourceManager/src/V3/TagKey.php index 45db29b7a3b5..b8ec25ddf970 100644 --- a/ResourceManager/src/V3/TagKey.php +++ b/ResourceManager/src/V3/TagKey.php @@ -24,8 +24,11 @@ class TagKey extends \Google\Protobuf\Internal\Message */ private $name = ''; /** - * Immutable. The resource name of the new TagKey's parent. - * Must be of the form `organizations/{org_id}`. + * Immutable. The resource name of the TagKey's parent. A TagKey can be + * parented by an Organization or a Project. For a TagKey parented by an + * Organization, its parent must be in the form `organizations/{org_id}`. For + * a TagKey parented by a Project, its parent can be in the form + * `projects/{project_id}` or `projects/{project_number}`. * * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; */ @@ -105,8 +108,11 @@ class TagKey extends \Google\Protobuf\Internal\Message * `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for * the TagKey. * @type string $parent - * Immutable. The resource name of the new TagKey's parent. - * Must be of the form `organizations/{org_id}`. + * Immutable. The resource name of the TagKey's parent. A TagKey can be + * parented by an Organization or a Project. For a TagKey parented by an + * Organization, its parent must be in the form `organizations/{org_id}`. For + * a TagKey parented by a Project, its parent can be in the form + * `projects/{project_id}` or `projects/{project_number}`. * @type string $short_name * Required. Immutable. The user friendly name for a TagKey. The short name * should be unique for TagKeys within the same tag namespace. @@ -176,8 +182,11 @@ public function setName($var) } /** - * Immutable. The resource name of the new TagKey's parent. - * Must be of the form `organizations/{org_id}`. + * Immutable. The resource name of the TagKey's parent. A TagKey can be + * parented by an Organization or a Project. For a TagKey parented by an + * Organization, its parent must be in the form `organizations/{org_id}`. For + * a TagKey parented by a Project, its parent can be in the form + * `projects/{project_id}` or `projects/{project_number}`. * * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; * @return string @@ -188,8 +197,11 @@ public function getParent() } /** - * Immutable. The resource name of the new TagKey's parent. - * Must be of the form `organizations/{org_id}`. + * Immutable. The resource name of the TagKey's parent. A TagKey can be + * parented by an Organization or a Project. For a TagKey parented by an + * Organization, its parent must be in the form `organizations/{org_id}`. For + * a TagKey parented by a Project, its parent can be in the form + * `projects/{project_id}` or `projects/{project_number}`. * * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; * @param string $var diff --git a/ResourceManager/src/V3/TagValue.php b/ResourceManager/src/V3/TagValue.php index 20e8a91c621a..429886930b70 100644 --- a/ResourceManager/src/V3/TagValue.php +++ b/ResourceManager/src/V3/TagValue.php @@ -40,10 +40,10 @@ class TagValue extends \Google\Protobuf\Internal\Message */ private $short_name = ''; /** - * Output only. Namespaced name of the TagValue. Now only supported in the - * format - * `{organization_id}/{tag_key_short_name}/{short_name}`. Other - * formats will be supported when we add non-org parented tags. + * Output only. The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. * * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -95,10 +95,10 @@ class TagValue extends \Google\Protobuf\Internal\Message * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), * dots (.), and alphanumerics between. * @type string $namespaced_name - * Output only. Namespaced name of the TagValue. Now only supported in the - * format - * `{organization_id}/{tag_key_short_name}/{short_name}`. Other - * formats will be supported when we add non-org parented tags. + * Output only. The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. * @type string $description * Optional. User-assigned description of the TagValue. * Must not exceed 256 characters. @@ -207,10 +207,10 @@ public function setShortName($var) } /** - * Output only. Namespaced name of the TagValue. Now only supported in the - * format - * `{organization_id}/{tag_key_short_name}/{short_name}`. Other - * formats will be supported when we add non-org parented tags. + * Output only. The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. * * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return string @@ -221,10 +221,10 @@ public function getNamespacedName() } /** - * Output only. Namespaced name of the TagValue. Now only supported in the - * format - * `{organization_id}/{tag_key_short_name}/{short_name}`. Other - * formats will be supported when we add non-org parented tags. + * Output only. The namespaced name of the TagValue. Can be in the form + * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. * * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param string $var diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Folders.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/Folders.php deleted file mode 100644 index de99506633a78f7f9412b3aed0f78cead696ed92..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5416 zcmcIoOK%%h6lR<~O za!rD!yJk+eZHGj`v3*Ue`&2j4N^!|DksWlVvuq-(xQHsop6PgiaR~uGln6v7n1J%E3-mA+f>*#f!e*nAEKT$-c0Jd-;2`L64G%|SG$9@) z;1K99n!alp2YD*rMV6orx(O+u(R29krP*nfInXlXD%(}vB1&wx`=GDjA^bN_P>yzE zLw&PJVMw^3hQ$()<$M&b$K2tHbusar(1*?@_YPkzalW+v|y7;Kf`}oYFMbk~PB*Ciy(C2~k1lgmsWZ1$O z==Uqmex7BcNXzE}T~aDwFt)kx;`0E(x4?NG09>kFxI}VyMUAxTZ(eK|#bq0P8ssBT zXkjZKfuSvAc!dfJVCZSg9pY?Lcf#h7AOzhw_TE9nMdf2Ke9HL$=*bosT%t`BFNFu7 zhXsu$rGuD}R3wxKU?^%;yy!G=0j&pkDXb3`-LE7txJ`Ss6)2+DDJY2ff_FY)JnmQ{ zUxWu2b7ce!MX?B1l+VGHHD?dS5&q{6f_DHc;$Adudhp`Pi_mGkZ5f{bSK(s%KKn2P3i6>yQko2Mhy$($_HS0+h#revbP)sBXQGW)7jrIgY#@R zAAT)?-jERC%$W=k%5suRw#_Qa_!qzZ@m*pB4w3obkerDNCC<>3M<+TxRpIv%=!>u! zoI4XyL|S0F- zp5{|FKG7MQ!lx4Gj}j0(I}%ZG0r9$k7Z}B3Mf6%8 zvvuJ%op?;0xS@8XuOM8(^5B2Aqb znf$l@j|DrrM;Pp%C2%RuYw+xjiYv5K7 zuDsSVa6tnSih8Jyx{fjVt#qu9w=tLes+TK4;QCrBwZFg5;f6ztQ41>UI&B)yj6uoq zs#BebNn539V@hnw#8gBP6WPE^& zQ1BVd-JNfE@-%UCh2HR~OXP-6-Q+iXYwVg(-I+TU5;=Ye7~TSMnH;_be34L?8BL>h rH0_ijP1~8^5s7_OYSX}2j&m!@@1rd^cG)G3M7#0)S>11Pa$JVP22J3cU;F|xe2HOP{X z)(LLN1+E;J;V*FFCve~g^a!_{dZ3qH87`dIU42CU$RzIIi*3DM&pz+RzIytJ({aEe zDqst{8o^D}=p)j>$Z>6A>$Zs+y;cjmNVmI=VPaQ8D7S~6?Nv}dSFF5CO+CBk>R3T- z+isg!)=j(DlwIsU?rN6S#;$yrm2J1JS;ljX7`Ej}+&=)8*2SKq=@=DCTf3NOO^s-^ z0(Vv0X0B@cgRW}T>;?e3sd*mSi@OBJ0MU=rYnX4}NV!I`( zswiztB3jv#%yJNxxieZQ<6~5m5s;gRxIG+?j*yE<&$TuHbe0i&))~!|7YV@mQ(`5H2ww%-~ zN_NGd^-8p^Gd?6QlGTrmpd{30Gpc|c+C7;lXDow{z&{XV-=J;aL*Gc^y(SIynsk^= z-wV8IjzJreWz%oCbYLknL5roV-UxCQDBO=(hK>W#gFs|xUHNcLreAf3(;vvwgYp4c z7?-y_?HZYcMEb_!57S^a-p=qgm}bKvB_JVleQWBaItA~8*{0z+rq-`>QQ}Or1m>HD zi*?$3{kq=sh~33*-Dsw!LY?GiS6~4oSo%?g|9ps=8e%R`YWLyaVQP`OouIXFvbNLB3p}8VRNP zS}lVoyz0W*2nKv`bXr!PM6U`tP8?jY<8xX*j{iN`7lf@DkhG8J1tfk2?iMhK8}H+9 zdbH!<&OkYQ^ioaytFBLuMbtpLj5Sy9#DjQYl)K=%L+`7)M=uLrc}bQz0p0_EKPUFr z*h)opCqM|26rbBat206T4!koqgy+ynjA0Jkj1%C|I8(HGR>SH!uc-%$ks`Wf;crQO z7?!vI(m7r(@dJi8tM~vc99VuijgzmxngKWC0uTNofLlX3fgfIob;u&%H$B-Q#pUn+ z{Ojk$0!*|0;h6RO<^Xl_KLmK?$b9j_7g2;IQle9jch-P z$4l^3^@|7oD1ceYSahF3F$_$HtaP|0#f2fb`5_(uP7_rg^@;c%=PYc~5#HE#62()5 z$EWJGP?y6g$HXIW;==z4ju(qJ1m|}FzzUrK3@&!NhUc-B24;rNKdKT!TfT&5kh3yp z?*nn|0`|xV9uE3W$l;1}hBWeoW{n;lV1}L3w+_1w%Nij?FS40uK(^JRkJTbjau+d5WN%xIyL%M@H!#-ZWM+4 qQIsJ^ic-xsuJX${`zYGPR{UK%wwkjQ!O+L7aBl34?R@su|4(B6Net!8>dL^DTn?6J#}VwX1(i=*j7_6Mmz7l`Ms~- z%)I;W*!wn^7FUsp9L+-&v2-kY`$)7M%d^UsA(rZUd&m*XR?XH8nsOBSoxQR@FeMvSHOLDF^wVYnrK5k&`-1r?AD3QQ324Y8n7jt0C9c%1B(@ zTwX_>R?$4Iuu82IR*03tR@6#iH+>I)vZ1-IxXG-6$3Vn?cD-ciWzqFC5C7cM-J)*l zo~{}CXV|ADaZfW`gq2%m_v&WZ(=AgZ3L9n_&D<7!n?&}eZQ&R!i5wT+*0XR(3OUn5 zj;R@i406kkZhMxqiA5Eqio770xg>f{9ffxnMF)9x$Gk^z z69Xr~e}y(tQ*FJVnx;jfV41F>G<<59=%lz}=*aZ?(|M>Pqq2bV7eng()zjS6r0@-l5~xv8<`!*p_z8PseYcRwj2 zzr~YGGes8mNTn1@tW=o5R7jH>W=q%ElCITKhYKnEQ?zN;*?Ka%9$A}aYepk~DJ#ey zGr;-EW*yBC)^L`X1cx6;csv!pfb{1%a31H0uo}Dq&JjXO2%<1EvOMri9f0Ft$krSj zjzo-q6yPKP*d9?S>XpO*Ul@eTV305aN}R*rE-lI|O&!B7vz_H_qUG;61uj%{*EY1{ zA_X(Z%?t1@7%e*pOBRV2i6Oi)x|rmfa2MsE+I)jpt8QanW?JWa)~X-_ajoIrv~UFR zAy7?>aL@xV2Zju-gbX(U!~u-=F2~!c7K5OyQMIh;Img5kAvq65L*L*i7&t)3ezxF6 zFnFjLb>!zsiM=gI?}9-ZR~QFZw)1K}TikiHy_sFfJONjd-%(cN7epI8VgV3>yiXNM$x zrq`rne3wo1saK>}LLj9=0mQeF=9KqY7z1x17{mc}SS9$VNsIR5rc?u0o2~z!-t2;j z723*8HSqwPXQ88Y-ACkz-!VxC@rYf1CxfXdcaXYxA$PzrFpRH3o>nsao*E`Ch9Osu zX>|-sUkhMjhZ4)n^?}eFBP>GXv_{)O4Gv_#7$-qIf`)r8eF5OQb%>fk{`cmCuK`%W zeXN`GPJt^nbWSunPKtx^(Eb6e55Po*66{L{CgD&-Ob2^@1g`Fwej~s9U8lfglX1T9 z;uBm~5N0yi{g4Wab69V5btS6h6O43?V!Q+|gkM-^D!X{V?*wouN=@+1t{X)aIKa31 z)?*N-Da1G&4?|R3O2=oaPrvX-0bGob59}V0h&+dRjl&FG{^a2DF1_dHREoq);k^b0I2>IuwDyTMhmy zfYA`$z%-9#$Lm%|x<_X;>dXx(*|w>a8fIHXm_1Vy#J@SQl_XEq>y6B`V@LP{&P#;D zddN#ezDHM9{aTuRAwNXp9@!>{`!52x+(dt{d%HDh^ay%~f}WPHw~v3FQ9R87CAd>n zYQ(z}OT(`)3u3Mf-sVu^wS!-7^5KFUUgS{YO)~!bT)Iyo-jQCX5c%af%)MmD5^P1G z4s$X11S8oFEw>;EFLpta>5jw=ZAFocaU^r1|0sn&3jpTvVNVbvr>46u86&{pAYu_} z72)V^H^r%)BqQ4mig-bq>l{0;1q#I-58-a0Og zCyrM4_WjA=Jbs;edzMq1>rWgH9<<85Wg5rJe+yt5zngeaI+4@zMSg9-zn--ze7Nq5 z`qKgW^r~7dlS+&kANM>M?8#=A?zMdRK6Yc34lCsqGOU!h*syZlA9>2V=~FIIVDrpi zpvhzkc%u0{Ci!L*h1yY+CPRv{n=TDuO82bvtzeup=MM`*vqdsJ(93P+id52{|DAvn G0R9C$nR@jA diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagBindings.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagBindings.php deleted file mode 100644 index 471ea270e629..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagBindings.php +++ /dev/null @@ -1,81 +0,0 @@ -internalAddGeneratedFile( - ' - -2google/cloud/resourcemanager/v3/tag_bindings.protogoogle.cloud.resourcemanager.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto" - -TagBinding -name ( BA -parent (  - tag_value ( ! -tag_value_namespaced_name ( :NAK -.cloudresourcemanager.googleapis.com/TagBindingtagBindings/{tag_binding}" -CreateTagBindingMetadata"| -CreateTagBindingRequestE - tag_binding ( 2+.google.cloud.resourcemanager.v3.TagBindingBA - validate_only (BA" -DeleteTagBindingMetadata"_ -DeleteTagBindingRequestD -name ( B6AA0 -.cloudresourcemanager.googleapis.com/TagBinding"d -ListTagBindingsRequest -parent ( B AA* - page_size (BA - -page_token ( BA"u -ListTagBindingsResponseA - tag_bindings ( 2+.google.cloud.resourcemanager.v3.TagBinding -next_page_token ( "` -ListEffectiveTagsRequest -parent ( BA - page_size (BA - -page_token ( BA"{ -ListEffectiveTagsResponseE -effective_tags ( 2-.google.cloud.resourcemanager.v3.EffectiveTag -next_page_token ( " - EffectiveTagD - tag_value ( B1A. -,cloudresourcemanager.googleapis.com/TagValue -namespaced_tag_value ( @ -tag_key ( B/A, -*cloudresourcemanager.googleapis.com/TagKey -namespaced_tag_key (  -tag_key_parent_name (  - inherited (2 - TagBindings -ListTagBindings7.google.cloud.resourcemanager.v3.ListTagBindingsRequest8.google.cloud.resourcemanager.v3.ListTagBindingsResponse" /v3/tagBindingsAparent -CreateTagBinding8.google.cloud.resourcemanager.v3.CreateTagBindingRequest.google.longrunning.Operation"["/v3/tagBindings: tag_bindingA tag_bindingA& - -TagBindingCreateTagBindingMetadata -DeleteTagBinding8.google.cloud.resourcemanager.v3.DeleteTagBindingRequest.google.longrunning.Operation"\\*/v3/{name=tagBindings/**}AnameA1 -google.protobuf.EmptyDeleteTagBindingMetadata -ListEffectiveTags9.google.cloud.resourcemanager.v3.ListEffectiveTagsRequest:.google.cloud.resourcemanager.v3.ListEffectiveTagsResponse""/v3/effectiveTagsAparentA#cloudresourcemanager.googleapis.comAghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB -#com.google.cloud.resourcemanager.v3BTagBindingsProtoPZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpbGoogle.Cloud.ResourceManager.V3Google\\Cloud\\ResourceManager\\V3"Google::Cloud::ResourceManager::V3bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagHolds.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagHolds.php deleted file mode 100644 index b277c3a03d51..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagHolds.php +++ /dev/null @@ -1,66 +0,0 @@ -internalAddGeneratedFile( - ' - -/google/cloud/resourcemanager/v3/tag_holds.protogoogle.cloud.resourcemanager.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/longrunning/operations.protogoogle/protobuf/empty.protogoogle/protobuf/timestamp.proto" -TagHold -name ( BA -holder ( BA -origin ( BA - help_link ( BA4 - create_time ( 2.google.protobuf.TimestampBA:[AX -+cloudresourcemanager.googleapis.com/TagHold)tagValues/{tag_value}/tagHolds/{tag_hold}" -CreateTagHoldRequestC -parent ( B3AA-+cloudresourcemanager.googleapis.com/TagHold? -tag_hold ( 2(.google.cloud.resourcemanager.v3.TagHoldBA - validate_only (BA" -CreateTagHoldMetadata"u -DeleteTagHoldRequestA -name ( B3AA- -+cloudresourcemanager.googleapis.com/TagHold - validate_only (BA" -DeleteTagHoldMetadata" -ListTagHoldsRequestC -parent ( B3AA-+cloudresourcemanager.googleapis.com/TagHold - page_size (BA - -page_token ( BA -filter ( BA"l -ListTagHoldsResponse; - tag_holds ( 2(.google.cloud.resourcemanager.v3.TagHold -next_page_token ( 2 -TagHolds - CreateTagHold5.google.cloud.resourcemanager.v3.CreateTagHoldRequest.google.longrunning.Operation"h-"!/v3/{parent=tagValues/*}/tagHolds:tag_holdAparent,tag_holdA -TagHoldCreateTagHoldMetadata - DeleteTagHold5.google.cloud.resourcemanager.v3.DeleteTagHoldRequest.google.longrunning.Operation"a#*!/v3/{name=tagValues/*/tagHolds/*}AnameA. -google.protobuf.EmptyDeleteTagHoldMetadata - ListTagHolds4.google.cloud.resourcemanager.v3.ListTagHoldsRequest5.google.cloud.resourcemanager.v3.ListTagHoldsResponse"2#!/v3/{parent=tagValues/*}/tagHoldsAparentA#cloudresourcemanager.googleapis.comAghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB -#com.google.cloud.resourcemanager.v3B TagHoldsProtoPZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpbGoogle.Cloud.ResourceManager.V3Google\\Cloud\\ResourceManager\\V3"Google::Cloud::ResourceManager::V3bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagKeys.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagKeys.php deleted file mode 100644 index b3516ce5ad3428347ae0450f8e6ac66090fca222..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4764 zcmb_gO-~y~819SU{*$t?DlJU{+c0Zg65Akrnq^y1>m*1Mn@ z2aTvgEWH*4HIL*gUeKuKBO*T69p9;uD8E0Gr%tW>h#bTwH;s_*)JYsV6{0Vf=GO>y zst$GRWp2e@U{>snRx9@Q%q&6`&xvDw%c*?=#?TX_!(Z6g@!X0YQ-{LOO*byPzDr%l zbH9co&FQ<27ZcDuDZAV7E7T2qohhvQ6*7KX7dDyf%`gB8=5z(C#8?4F>=mDq$ag$@ zk;IkA4QUXSK-98ogeF|FFXOl6w#=NntB(temURN;oKB+#N$;-f5uuI9pXIojfy3lK z`xMd&p=%d>KVU2ber#FIGc`?|rMTd^#HXFLaIVhFpKRwIO>E46yt(}JTyt*&MJn%mz;yy<7(@( zg2pTfc?Lwon`lt#mstxoI>cH%S)o0P2DcB)o(# zqV9diYY^cdD|1h?iZ2WEXo7=Q@hBUZ!~&rlo6rjL%J0AgYeV@b@DJ;5hZ~w^e1Y() z8&e?@Z;&q=kiz&{5)dLv`oZu2f*Z66Jc9Z|Xp`j_+7*Y>Er_{_5dThtN5s#HaAAxY zE*fsxAr7J56Z`?{lQ?2HBqPxtYm-HM6~d2vMa!uTdEgpbXlR+p!>F@-+!F88{3Mf| zFlT&@a$xm=ngObUtk-8hM8gX_C0Y&7pSMUm@DkkL0`5iP5lUKd z|8M8NibYmRd3{MmI{-}MPyi?HqF$Ne5WT~tha08!&0_iCgUwQLVP$EhxH$9%9zui5 z3&rx%%0}_i!s_afHvM7{^@;<<_^E~lQi+6T&drvTv<%kV-OiLmt{T_B`Rm1xnTvQp z&c>{a92I2Gz~5=8Kgl{gb?y#{tOC_`;v1tJ$Oyj7fIML>Xbw_@SG9@5qXKVi_-BZP zQ}Pwhwu9`9EYG!%@fOFJ#Um-Q^386kQ2wT&!E_4Z^Iek`SKPg=4waf9%wz&ImIYx( z+H;mFD@O(O-?PFy$$W5XVZeU?+;rx(0XHq)Cfq8AYmZG|=MDznvPNYdb9Cwe!%}3j zA*KUXU0M#42BDG>{{n|eXK5RUNsG66m_@<;#H)g}1#5bb1S?dwL5Sw$DuE5Es<9!JLhMSI>||*ZM}b0Umj;Z0! z?1?YGW^OF=M-_8{J*t=+@=;|?Jk6NfGtZQSE#F;|hZiYh!^_Ldj3LZe7Pn(r#|&B4 h_RLNXzb(y-CHKxr@v4z}1Ud5ogiDHtibHgW(0_DxOLqVO diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagValues.php b/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagValues.php deleted file mode 100644 index f0011723b145..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/GPBMetadata/Google/Cloud/Resourcemanager/V3/TagValues.php +++ /dev/null @@ -1,90 +0,0 @@ -internalAddGeneratedFile( - ' - -0google/cloud/resourcemanager/v3/tag_values.protogoogle.cloud.resourcemanager.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.proto#google/longrunning/operations.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto" -TagValue -name ( BA -parent ( BA - -short_name ( BAA -namespaced_name ( BA - description ( BA4 - create_time ( 2.google.protobuf.TimestampBA4 - update_time ( 2.google.protobuf.TimestampBA -etag ( BA:KAH -,cloudresourcemanager.googleapis.com/TagValuetagValues/{tag_value}R"b -ListTagValuesRequest -parent ( B AA* - page_size (BA - -page_token ( BA"o -ListTagValuesResponse= - -tag_values ( 2).google.cloud.resourcemanager.v3.TagValue -next_page_token ( "X -GetTagValueRequestB -name ( B4AA. -,cloudresourcemanager.googleapis.com/TagValue"b -GetNamespacedTagValueRequestB -name ( B4AA. -,cloudresourcemanager.googleapis.com/TagValue"v -CreateTagValueRequestA - tag_value ( 2).google.cloud.resourcemanager.v3.TagValueBA - validate_only (BA" -CreateTagValueMetadata" -UpdateTagValueRequestA - tag_value ( 2).google.cloud.resourcemanager.v3.TagValueBA4 - update_mask ( 2.google.protobuf.FieldMaskBA - validate_only (BA" -UpdateTagValueMetadata" -DeleteTagValueRequestB -name ( B4AA. -,cloudresourcemanager.googleapis.com/TagValue - validate_only (BA -etag ( BA" -DeleteTagValueMetadata2 - TagValues - ListTagValues5.google.cloud.resourcemanager.v3.ListTagValuesRequest6.google.cloud.resourcemanager.v3.ListTagValuesResponse" /v3/tagValuesAparent - GetTagValue3.google.cloud.resourcemanager.v3.GetTagValueRequest).google.cloud.resourcemanager.v3.TagValue"%/v3/{name=tagValues/*}Aname -GetNamespacedTagValue=.google.cloud.resourcemanager.v3.GetNamespacedTagValueRequest).google.cloud.resourcemanager.v3.TagValue"\'/v3/tagValues/namespacedAname -CreateTagValue6.google.cloud.resourcemanager.v3.CreateTagValueRequest.google.longrunning.Operation"Q" /v3/tagValues: tag_valueA tag_valueA" -TagValueCreateTagValueMetadata -UpdateTagValue6.google.cloud.resourcemanager.v3.UpdateTagValueRequest.google.longrunning.Operation"p-2 /v3/{tag_value.name=tagValues/*}: tag_valueAtag_value,update_maskA" -TagValueUpdateTagValueMetadata -DeleteTagValue6.google.cloud.resourcemanager.v3.DeleteTagValueRequest.google.longrunning.Operation"J*/v3/{name=tagValues/*}AnameA" -TagValueDeleteTagValueMetadata - GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy"=,"\'/v3/{resource=tagValues/*}:getIamPolicy:*Aresource - SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy"D,"\'/v3/{resource=tagValues/*}:setIamPolicy:*Aresource,policy -TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"O2"-/v3/{resource=tagValues/*}:testIamPermissions:*Aresource,permissionsA#cloudresourcemanager.googleapis.comAghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB -#com.google.cloud.resourcemanager.v3BTagValuesProtoPZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpbGoogle.Cloud.ResourceManager.V3Google\\Cloud\\ResourceManager\\V3"Google::Cloud::ResourceManager::V3bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderMetadata.php deleted file mode 100644 index 965bede9e76c..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderMetadata.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.resourcemanager.v3.CreateFolderMetadata - */ -class CreateFolderMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The display name of the folder. - * - * Generated from protobuf field string display_name = 1; - */ - protected $display_name = ''; - /** - * The resource name of the folder or organization we are creating the folder - * under. - * - * Generated from protobuf field string parent = 2; - */ - protected $parent = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $display_name - * The display name of the folder. - * @type string $parent - * The resource name of the folder or organization we are creating the folder - * under. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * The display name of the folder. - * - * Generated from protobuf field string display_name = 1; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * The display name of the folder. - * - * Generated from protobuf field string display_name = 1; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * The resource name of the folder or organization we are creating the folder - * under. - * - * Generated from protobuf field string parent = 2; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The resource name of the folder or organization we are creating the folder - * under. - * - * Generated from protobuf field string parent = 2; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderRequest.php deleted file mode 100644 index b4c7030c11ae..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateFolderRequest.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.resourcemanager.v3.CreateFolderRequest - */ -class CreateFolderRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The folder being created, only the display name and parent will - * be consulted. All other fields will be ignored. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $folder = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceManager\V3\Folder $folder - * Required. The folder being created, only the display name and parent will - * be consulted. All other fields will be ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Required. The folder being created, only the display name and parent will - * be consulted. All other fields will be ignored. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\Folder|null - */ - public function getFolder() - { - return $this->folder; - } - - public function hasFolder() - { - return isset($this->folder); - } - - public function clearFolder() - { - unset($this->folder); - } - - /** - * Required. The folder being created, only the display name and parent will - * be consulted. All other fields will be ignored. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\Folder $var - * @return $this - */ - public function setFolder($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\Folder::class); - $this->folder = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectMetadata.php deleted file mode 100644 index 64d5f69ff7bd..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectMetadata.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.resourcemanager.v3.CreateProjectMetadata - */ -class CreateProjectMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Creation time of the project creation workflow. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - */ - protected $create_time = null; - /** - * True if the project can be retrieved using `GetProject`. No other - * operations on the project are guaranteed to work until the project creation - * is complete. - * - * Generated from protobuf field bool gettable = 2; - */ - protected $gettable = false; - /** - * True if the project creation process is complete. - * - * Generated from protobuf field bool ready = 3; - */ - protected $ready = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Creation time of the project creation workflow. - * @type bool $gettable - * True if the project can be retrieved using `GetProject`. No other - * operations on the project are guaranteed to work until the project creation - * is complete. - * @type bool $ready - * True if the project creation process is complete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Creation time of the project creation workflow. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - * @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); - } - - /** - * Creation time of the project creation workflow. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * True if the project can be retrieved using `GetProject`. No other - * operations on the project are guaranteed to work until the project creation - * is complete. - * - * Generated from protobuf field bool gettable = 2; - * @return bool - */ - public function getGettable() - { - return $this->gettable; - } - - /** - * True if the project can be retrieved using `GetProject`. No other - * operations on the project are guaranteed to work until the project creation - * is complete. - * - * Generated from protobuf field bool gettable = 2; - * @param bool $var - * @return $this - */ - public function setGettable($var) - { - GPBUtil::checkBool($var); - $this->gettable = $var; - - return $this; - } - - /** - * True if the project creation process is complete. - * - * Generated from protobuf field bool ready = 3; - * @return bool - */ - public function getReady() - { - return $this->ready; - } - - /** - * True if the project creation process is complete. - * - * Generated from protobuf field bool ready = 3; - * @param bool $var - * @return $this - */ - public function setReady($var) - { - GPBUtil::checkBool($var); - $this->ready = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectRequest.php deleted file mode 100644 index a565e7f07cc4..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateProjectRequest.php +++ /dev/null @@ -1,103 +0,0 @@ -google.cloud.resourcemanager.v3.CreateProjectRequest - */ -class CreateProjectRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The Project to create. - * Project ID is required. If the requested ID is unavailable, the request - * fails. - * If the `parent` field is set, the `resourcemanager.projects.create` - * permission is checked on the parent resource. If no parent is set and - * the authorization credentials belong to an Organization, the parent - * will be set to that Organization. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $project = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceManager\V3\Project $project - * Required. The Project to create. - * Project ID is required. If the requested ID is unavailable, the request - * fails. - * If the `parent` field is set, the `resourcemanager.projects.create` - * permission is checked on the parent resource. If no parent is set and - * the authorization credentials belong to an Organization, the parent - * will be set to that Organization. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Required. The Project to create. - * Project ID is required. If the requested ID is unavailable, the request - * fails. - * If the `parent` field is set, the `resourcemanager.projects.create` - * permission is checked on the parent resource. If no parent is set and - * the authorization credentials belong to an Organization, the parent - * will be set to that Organization. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\Project|null - */ - public function getProject() - { - return $this->project; - } - - public function hasProject() - { - return isset($this->project); - } - - public function clearProject() - { - unset($this->project); - } - - /** - * Required. The Project to create. - * Project ID is required. If the requested ID is unavailable, the request - * fails. - * If the `parent` field is set, the `resourcemanager.projects.create` - * permission is checked on the parent resource. If no parent is set and - * the authorization credentials belong to an Organization, the parent - * will be set to that Organization. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\Project $var - * @return $this - */ - public function setProject($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\Project::class); - $this->project = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingMetadata.php deleted file mode 100644 index 417b98c428c2..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.resourcemanager.v3.CreateTagBindingMetadata - */ -class CreateTagBindingMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingRequest.php deleted file mode 100644 index 2874d41e84c6..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagBindingRequest.php +++ /dev/null @@ -1,115 +0,0 @@ -google.cloud.resourcemanager.v3.CreateTagBindingRequest - */ -class CreateTagBindingRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The TagBinding to be created. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $tag_binding = null; - /** - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceManager\V3\TagBinding $tag_binding - * Required. The TagBinding to be created. - * @type bool $validate_only - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - - /** - * Required. The TagBinding to be created. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\TagBinding|null - */ - public function getTagBinding() - { - return $this->tag_binding; - } - - public function hasTagBinding() - { - return isset($this->tag_binding); - } - - public function clearTagBinding() - { - unset($this->tag_binding); - } - - /** - * Required. The TagBinding to be created. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\TagBinding $var - * @return $this - */ - public function setTagBinding($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagBinding::class); - $this->tag_binding = $var; - - return $this; - } - - /** - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldMetadata.php deleted file mode 100644 index ad0b4f18f9b5..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldMetadata.php +++ /dev/null @@ -1,35 +0,0 @@ -google.cloud.resourcemanager.v3.CreateTagHoldMetadata - */ -class CreateTagHoldMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldRequest.php deleted file mode 100644 index cddfa61f81bf..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagHoldRequest.php +++ /dev/null @@ -1,153 +0,0 @@ -google.cloud.resourcemanager.v3.CreateTagHoldRequest - */ -class CreateTagHoldRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the TagHold's parent TagValue. Must be of - * the form: `tagValues/{tag-value-id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The TagHold to be created. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagHold tag_hold = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $tag_hold = null; - /** - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the TagHold's parent TagValue. Must be of - * the form: `tagValues/{tag-value-id}`. - * @type \Google\Cloud\ResourceManager\V3\TagHold $tag_hold - * Required. The TagHold to be created. - * @type bool $validate_only - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the TagHold's parent TagValue. Must be of - * the form: `tagValues/{tag-value-id}`. - * - * 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 TagHold's parent TagValue. Must be of - * the form: `tagValues/{tag-value-id}`. - * - * 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 TagHold to be created. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagHold tag_hold = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\TagHold|null - */ - public function getTagHold() - { - return $this->tag_hold; - } - - public function hasTagHold() - { - return isset($this->tag_hold); - } - - public function clearTagHold() - { - unset($this->tag_hold); - } - - /** - * Required. The TagHold to be created. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagHold tag_hold = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\TagHold $var - * @return $this - */ - public function setTagHold($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagHold::class); - $this->tag_hold = $var; - - return $this; - } - - /** - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyMetadata.php deleted file mode 100644 index 6dcfd2f3e912..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.resourcemanager.v3.CreateTagKeyMetadata - */ -class CreateTagKeyMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyRequest.php deleted file mode 100644 index 457aa1452447..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagKeyRequest.php +++ /dev/null @@ -1,119 +0,0 @@ -google.cloud.resourcemanager.v3.CreateTagKeyRequest - */ -class CreateTagKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The TagKey to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $tag_key = null; - /** - * Optional. Set to true to perform validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceManager\V3\TagKey $tag_key - * Required. The TagKey to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * @type bool $validate_only - * Optional. Set to true to perform validations necessary for creating the - * resource, but not actually perform the action. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - - /** - * Required. The TagKey to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\TagKey|null - */ - public function getTagKey() - { - return $this->tag_key; - } - - public function hasTagKey() - { - return isset($this->tag_key); - } - - public function clearTagKey() - { - unset($this->tag_key); - } - - /** - * Required. The TagKey to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\TagKey $var - * @return $this - */ - public function setTagKey($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagKey::class); - $this->tag_key = $var; - - return $this; - } - - /** - * Optional. Set to true to perform validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. Set to true to perform validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueMetadata.php deleted file mode 100644 index 4783b3262bab..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.resourcemanager.v3.CreateTagValueMetadata - */ -class CreateTagValueMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueRequest.php deleted file mode 100644 index c04330efa387..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/CreateTagValueRequest.php +++ /dev/null @@ -1,119 +0,0 @@ -google.cloud.resourcemanager.v3.CreateTagValueRequest - */ -class CreateTagValueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The TagValue to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $tag_value = null; - /** - * Optional. Set as true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceManager\V3\TagValue $tag_value - * Required. The TagValue to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * @type bool $validate_only - * Optional. Set as true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - - /** - * Required. The TagValue to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\TagValue|null - */ - public function getTagValue() - { - return $this->tag_value; - } - - public function hasTagValue() - { - return isset($this->tag_value); - } - - public function clearTagValue() - { - unset($this->tag_value); - } - - /** - * Required. The TagValue to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\TagValue $var - * @return $this - */ - public function setTagValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagValue::class); - $this->tag_value = $var; - - return $this; - } - - /** - * Optional. Set as true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. Set as true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderMetadata.php deleted file mode 100644 index 218142421f95..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteFolderMetadata - */ -class DeleteFolderMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderRequest.php deleted file mode 100644 index b22fd65f7eab..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteFolderRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteFolderRequest - */ -class DeleteFolderRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the folder to be deleted. - * Must be of the form `folders/{folder_id}`. - * - * 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 resource name of the folder to be deleted. - * Must be of the form `folders/{folder_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the folder to be deleted. - * Must be of the form `folders/{folder_id}`. - * - * 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 resource name of the folder to be deleted. - * Must be of the form `folders/{folder_id}`. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteOrganizationMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteOrganizationMetadata.php deleted file mode 100644 index e1f9c4856206..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteOrganizationMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteOrganizationMetadata - */ -class DeleteOrganizationMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectMetadata.php deleted file mode 100644 index ccb5bc729caf..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteProjectMetadata - */ -class DeleteProjectMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectRequest.php deleted file mode 100644 index 46af54101c2c..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteProjectRequest.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteProjectRequest - */ -class DeleteProjectRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the Project (for example, `projects/415104041262`). - * - * 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 Project (for example, `projects/415104041262`). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the Project (for example, `projects/415104041262`). - * - * 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 Project (for example, `projects/415104041262`). - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingMetadata.php deleted file mode 100644 index ceaecd1073fa..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteTagBindingMetadata - */ -class DeleteTagBindingMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingRequest.php deleted file mode 100644 index 6a9bd97cae5b..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagBindingRequest.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteTagBindingRequest - */ -class DeleteTagBindingRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the TagBinding. This is a String of the form: - * `tagBindings/{id}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - * - * 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 TagBinding. This is a String of the form: - * `tagBindings/{id}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the TagBinding. This is a String of the form: - * `tagBindings/{id}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - * - * 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 TagBinding. This is a String of the form: - * `tagBindings/{id}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldMetadata.php deleted file mode 100644 index dc16e59f2a7e..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldMetadata.php +++ /dev/null @@ -1,35 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteTagHoldMetadata - */ -class DeleteTagHoldMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldRequest.php deleted file mode 100644 index b3a72dc96881..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagHoldRequest.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteTagHoldRequest - */ -class DeleteTagHoldRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the TagHold to delete. Must be of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. Set to true to perform the validations necessary for deleting the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the TagHold to delete. Must be of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. - * @type bool $validate_only - * Optional. Set to true to perform the validations necessary for deleting the - * resource, but not actually perform the action. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the TagHold to delete. Must be of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. - * - * 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 resource name of the TagHold to delete. Must be of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. - * - * 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. Set to true to perform the validations necessary for deleting the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. Set to true to perform the validations necessary for deleting the - * resource, but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyMetadata.php deleted file mode 100644 index f4c106279114..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteTagKeyMetadata - */ -class DeleteTagKeyMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyRequest.php deleted file mode 100644 index 101222fd0599..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagKeyRequest.php +++ /dev/null @@ -1,151 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteTagKeyRequest - */ -class DeleteTagKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of a TagKey to be deleted in the format - * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or - * it will not be deleted successfully. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. Set as true to perform validations necessary for deletion, but - * not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. The etag known to the client for the expected state of the - * TagKey. This is to be used for optimistic concurrency. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of a TagKey to be deleted in the format - * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or - * it will not be deleted successfully. - * @type bool $validate_only - * Optional. Set as true to perform validations necessary for deletion, but - * not actually perform the action. - * @type string $etag - * Optional. The etag known to the client for the expected state of the - * TagKey. This is to be used for optimistic concurrency. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of a TagKey to be deleted in the format - * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or - * it will not be deleted successfully. - * - * 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 resource name of a TagKey to be deleted in the format - * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or - * it will not be deleted successfully. - * - * 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. Set as true to perform validations necessary for deletion, but - * not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. Set as true to perform validations necessary for deletion, but - * not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. The etag known to the client for the expected state of the - * TagKey. This is to be used for optimistic concurrency. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The etag known to the client for the expected state of the - * TagKey. This is to be used for optimistic concurrency. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueMetadata.php deleted file mode 100644 index 0b447cb8bcd4..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteTagValueMetadata - */ -class DeleteTagValueMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueRequest.php deleted file mode 100644 index 9440dd2a4d00..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/DeleteTagValueRequest.php +++ /dev/null @@ -1,147 +0,0 @@ -google.cloud.resourcemanager.v3.DeleteTagValueRequest - */ -class DeleteTagValueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Resource name for TagValue to be deleted in the format - * tagValues/456. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. Set as true to perform the validations necessary for deletion, - * but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - /** - * Optional. The etag known to the client for the expected state of the - * TagValue. This is to be used for optimistic concurrency. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Resource name for TagValue to be deleted in the format - * tagValues/456. - * @type bool $validate_only - * Optional. Set as true to perform the validations necessary for deletion, - * but not actually perform the action. - * @type string $etag - * Optional. The etag known to the client for the expected state of the - * TagValue. This is to be used for optimistic concurrency. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - - /** - * Required. Resource name for TagValue to be deleted in the format - * tagValues/456. - * - * 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. Resource name for TagValue to be deleted in the format - * tagValues/456. - * - * 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. Set as true to perform the validations necessary for deletion, - * but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. Set as true to perform the validations necessary for deletion, - * but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - - /** - * Optional. The etag known to the client for the expected state of the - * TagValue. This is to be used for optimistic concurrency. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The etag known to the client for the expected state of the - * TagValue. This is to be used for optimistic concurrency. - * - * Generated from protobuf field string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/EffectiveTag.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/EffectiveTag.php deleted file mode 100644 index 321ccbdb0248..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/EffectiveTag.php +++ /dev/null @@ -1,289 +0,0 @@ -google.cloud.resourcemanager.v3.EffectiveTag - */ -class EffectiveTag extends \Google\Protobuf\Internal\Message -{ - /** - * Resource name for TagValue in the format `tagValues/456`. - * - * Generated from protobuf field string tag_value = 1 [(.google.api.resource_reference) = { - */ - protected $tag_value = ''; - /** - * The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * - * Generated from protobuf field string namespaced_tag_value = 2; - */ - protected $namespaced_tag_value = ''; - /** - * The name of the TagKey, in the format `tagKeys/{id}`, such as - * `tagKeys/123`. - * - * Generated from protobuf field string tag_key = 3 [(.google.api.resource_reference) = { - */ - protected $tag_key = ''; - /** - * The namespaced name of the TagKey. Can be in the form - * `{organization_id}/{tag_key_short_name}` or - * `{project_id}/{tag_key_short_name}` or - * `{project_number}/{tag_key_short_name}`. - * - * Generated from protobuf field string namespaced_tag_key = 4; - */ - protected $namespaced_tag_key = ''; - /** - * The parent name of the tag key. - * Must be in the format `organizations/{organization_id}` or - * `projects/{project_number}` - * - * Generated from protobuf field string tag_key_parent_name = 6; - */ - protected $tag_key_parent_name = ''; - /** - * Indicates the inheritance status of a tag value - * attached to the given resource. If the tag value is inherited from one of - * the resource's ancestors, inherited will be true. If false, then the tag - * value is directly attached to the resource, inherited will be false. - * - * Generated from protobuf field bool inherited = 5; - */ - protected $inherited = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $tag_value - * Resource name for TagValue in the format `tagValues/456`. - * @type string $namespaced_tag_value - * The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * @type string $tag_key - * The name of the TagKey, in the format `tagKeys/{id}`, such as - * `tagKeys/123`. - * @type string $namespaced_tag_key - * The namespaced name of the TagKey. Can be in the form - * `{organization_id}/{tag_key_short_name}` or - * `{project_id}/{tag_key_short_name}` or - * `{project_number}/{tag_key_short_name}`. - * @type string $tag_key_parent_name - * The parent name of the tag key. - * Must be in the format `organizations/{organization_id}` or - * `projects/{project_number}` - * @type bool $inherited - * Indicates the inheritance status of a tag value - * attached to the given resource. If the tag value is inherited from one of - * the resource's ancestors, inherited will be true. If false, then the tag - * value is directly attached to the resource, inherited will be false. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - - /** - * Resource name for TagValue in the format `tagValues/456`. - * - * Generated from protobuf field string tag_value = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getTagValue() - { - return $this->tag_value; - } - - /** - * Resource name for TagValue in the format `tagValues/456`. - * - * Generated from protobuf field string tag_value = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setTagValue($var) - { - GPBUtil::checkString($var, True); - $this->tag_value = $var; - - return $this; - } - - /** - * The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * - * Generated from protobuf field string namespaced_tag_value = 2; - * @return string - */ - public function getNamespacedTagValue() - { - return $this->namespaced_tag_value; - } - - /** - * The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * - * Generated from protobuf field string namespaced_tag_value = 2; - * @param string $var - * @return $this - */ - public function setNamespacedTagValue($var) - { - GPBUtil::checkString($var, True); - $this->namespaced_tag_value = $var; - - return $this; - } - - /** - * The name of the TagKey, in the format `tagKeys/{id}`, such as - * `tagKeys/123`. - * - * Generated from protobuf field string tag_key = 3 [(.google.api.resource_reference) = { - * @return string - */ - public function getTagKey() - { - return $this->tag_key; - } - - /** - * The name of the TagKey, in the format `tagKeys/{id}`, such as - * `tagKeys/123`. - * - * Generated from protobuf field string tag_key = 3 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setTagKey($var) - { - GPBUtil::checkString($var, True); - $this->tag_key = $var; - - return $this; - } - - /** - * The namespaced name of the TagKey. Can be in the form - * `{organization_id}/{tag_key_short_name}` or - * `{project_id}/{tag_key_short_name}` or - * `{project_number}/{tag_key_short_name}`. - * - * Generated from protobuf field string namespaced_tag_key = 4; - * @return string - */ - public function getNamespacedTagKey() - { - return $this->namespaced_tag_key; - } - - /** - * The namespaced name of the TagKey. Can be in the form - * `{organization_id}/{tag_key_short_name}` or - * `{project_id}/{tag_key_short_name}` or - * `{project_number}/{tag_key_short_name}`. - * - * Generated from protobuf field string namespaced_tag_key = 4; - * @param string $var - * @return $this - */ - public function setNamespacedTagKey($var) - { - GPBUtil::checkString($var, True); - $this->namespaced_tag_key = $var; - - return $this; - } - - /** - * The parent name of the tag key. - * Must be in the format `organizations/{organization_id}` or - * `projects/{project_number}` - * - * Generated from protobuf field string tag_key_parent_name = 6; - * @return string - */ - public function getTagKeyParentName() - { - return $this->tag_key_parent_name; - } - - /** - * The parent name of the tag key. - * Must be in the format `organizations/{organization_id}` or - * `projects/{project_number}` - * - * Generated from protobuf field string tag_key_parent_name = 6; - * @param string $var - * @return $this - */ - public function setTagKeyParentName($var) - { - GPBUtil::checkString($var, True); - $this->tag_key_parent_name = $var; - - return $this; - } - - /** - * Indicates the inheritance status of a tag value - * attached to the given resource. If the tag value is inherited from one of - * the resource's ancestors, inherited will be true. If false, then the tag - * value is directly attached to the resource, inherited will be false. - * - * Generated from protobuf field bool inherited = 5; - * @return bool - */ - public function getInherited() - { - return $this->inherited; - } - - /** - * Indicates the inheritance status of a tag value - * attached to the given resource. If the tag value is inherited from one of - * the resource's ancestors, inherited will be true. If false, then the tag - * value is directly attached to the resource, inherited will be false. - * - * Generated from protobuf field bool inherited = 5; - * @param bool $var - * @return $this - */ - public function setInherited($var) - { - GPBUtil::checkBool($var); - $this->inherited = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder.php deleted file mode 100644 index a2a3f4bc7eba..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder.php +++ /dev/null @@ -1,392 +0,0 @@ -google.cloud.resourcemanager.v3.Folder - */ -class Folder extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name of the folder. - * Its format is `folders/{folder_id}`, for example: "folders/1234". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Required. The folder's parent's resource name. - * Updates to the folder's parent must be performed using - * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder]. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - /** - * The folder's display name. - * A folder's display name must be unique amongst its siblings. For example, - * no two folders with the same parent can share the same display name. - * The display name must start and end with a letter or digit, may contain - * letters, digits, spaces, hyphens and underscores and can be no longer - * than 30 characters. This is captured by the regular expression: - * `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. - * - * Generated from protobuf field string display_name = 3; - */ - protected $display_name = ''; - /** - * Output only. The lifecycle state of the folder. - * Updates to the state must be performed using - * [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and - * [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder]. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. Timestamp when the folder was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Timestamp when the folder was last modified. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. Timestamp when the folder was requested to be deleted. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Output only. A checksum computed by the server based on the current value - * of the folder resource. This may be sent on update and delete requests to - * ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name of the folder. - * Its format is `folders/{folder_id}`, for example: "folders/1234". - * @type string $parent - * Required. The folder's parent's resource name. - * Updates to the folder's parent must be performed using - * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder]. - * @type string $display_name - * The folder's display name. - * A folder's display name must be unique amongst its siblings. For example, - * no two folders with the same parent can share the same display name. - * The display name must start and end with a letter or digit, may contain - * letters, digits, spaces, hyphens and underscores and can be no longer - * than 30 characters. This is captured by the regular expression: - * `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. - * @type int $state - * Output only. The lifecycle state of the folder. - * Updates to the state must be performed using - * [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and - * [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder]. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Timestamp when the folder was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Timestamp when the folder was last modified. - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. Timestamp when the folder was requested to be deleted. - * @type string $etag - * Output only. A checksum computed by the server based on the current value - * of the folder resource. This may be sent on update and delete requests to - * ensure the client has an up-to-date value before proceeding. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name of the folder. - * Its format is `folders/{folder_id}`, for example: "folders/1234". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The resource name of the folder. - * Its format is `folders/{folder_id}`, for example: "folders/1234". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The folder's parent's resource name. - * Updates to the folder's parent must be performed using - * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder]. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The folder's parent's resource name. - * Updates to the folder's parent must be performed using - * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder]. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The folder's display name. - * A folder's display name must be unique amongst its siblings. For example, - * no two folders with the same parent can share the same display name. - * The display name must start and end with a letter or digit, may contain - * letters, digits, spaces, hyphens and underscores and can be no longer - * than 30 characters. This is captured by the regular expression: - * `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. - * - * Generated from protobuf field string display_name = 3; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * The folder's display name. - * A folder's display name must be unique amongst its siblings. For example, - * no two folders with the same parent can share the same display name. - * The display name must start and end with a letter or digit, may contain - * letters, digits, spaces, hyphens and underscores and can be no longer - * than 30 characters. This is captured by the regular expression: - * `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. - * - * Generated from protobuf field string display_name = 3; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. The lifecycle state of the folder. - * Updates to the state must be performed using - * [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and - * [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder]. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The lifecycle state of the folder. - * Updates to the state must be performed using - * [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and - * [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder]. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V3\Folder\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Timestamp when the folder was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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. Timestamp when the folder was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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. Timestamp when the folder was last modified. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.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. Timestamp when the folder was last modified. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.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. Timestamp when the folder was requested to be deleted. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. Timestamp when the folder was requested to be deleted. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Output only. A checksum computed by the server based on the current value - * of the folder resource. This may be sent on update and delete requests to - * ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Output only. A checksum computed by the server based on the current value - * of the folder resource. This may be sent on update and delete requests to - * ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder/State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder/State.php deleted file mode 100644 index 1758cdf0f34b..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder/State.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.resourcemanager.v3.Folder.State - */ -class State -{ - /** - * Unspecified state. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The normal and active state. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * The folder has been marked for deletion by the user. - * - * Generated from protobuf enum DELETE_REQUESTED = 2; - */ - const DELETE_REQUESTED = 2; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::DELETE_REQUESTED => 'DELETE_REQUESTED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\ResourceManager\V3\Folder_State::class); - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder_State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder_State.php deleted file mode 100644 index 9f625b05f94d..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Folder_State.php +++ /dev/null @@ -1,16 +0,0 @@ -_simpleRequest('/google.cloud.resourcemanager.v3.Folders/GetFolder', - $argument, - ['\Google\Cloud\ResourceManager\V3\Folder', 'decode'], - $metadata, $options); - } - - /** - * Lists the folders that are direct descendants of supplied parent resource. - * `list()` provides a strongly consistent view of the folders underneath - * the specified parent resource. - * `list()` returns folders sorted based upon the (ascending) lexical ordering - * of their display_name. - * The caller must have `resourcemanager.folders.list` permission on the - * identified parent. - * @param \Google\Cloud\ResourceManager\V3\ListFoldersRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListFolders(\Google\Cloud\ResourceManager\V3\ListFoldersRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/ListFolders', - $argument, - ['\Google\Cloud\ResourceManager\V3\ListFoldersResponse', 'decode'], - $metadata, $options); - } - - /** - * Search for folders that match specific filter criteria. - * `search()` provides an eventually consistent view of the folders a user has - * access to which meet the specified filter criteria. - * - * This will only return folders on which the caller has the - * permission `resourcemanager.folders.get`. - * @param \Google\Cloud\ResourceManager\V3\SearchFoldersRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SearchFolders(\Google\Cloud\ResourceManager\V3\SearchFoldersRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/SearchFolders', - $argument, - ['\Google\Cloud\ResourceManager\V3\SearchFoldersResponse', 'decode'], - $metadata, $options); - } - - /** - * Creates a folder in the resource hierarchy. - * Returns an `Operation` which can be used to track the progress of the - * folder creation workflow. - * Upon success, the `Operation.response` field will be populated with the - * created Folder. - * - * In order to succeed, the addition of this new folder must not violate - * the folder naming, height, or fanout constraints. - * - * + The folder's `display_name` must be distinct from all other folders that - * share its parent. - * + The addition of the folder must not cause the active folder hierarchy - * to exceed a height of 10. Note, the full active + deleted folder hierarchy - * is allowed to reach a height of 20; this provides additional headroom when - * moving folders that contain deleted folders. - * + The addition of the folder must not cause the total number of folders - * under its parent to exceed 300. - * - * If the operation fails due to a folder constraint violation, some errors - * may be returned by the `CreateFolder` request, with status code - * `FAILED_PRECONDITION` and an error description. Other folder constraint - * violations will be communicated in the `Operation`, with the specific - * `PreconditionFailure` returned in the details list in the `Operation.error` - * field. - * - * The caller must have `resourcemanager.folders.create` permission on the - * identified parent. - * @param \Google\Cloud\ResourceManager\V3\CreateFolderRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateFolder(\Google\Cloud\ResourceManager\V3\CreateFolderRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/CreateFolder', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates a folder, changing its `display_name`. - * Changes to the folder `display_name` will be rejected if they violate - * either the `display_name` formatting rules or the naming constraints - * described in the - * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] - * documentation. - * - * The folder's `display_name` must start and end with a letter or digit, - * may contain letters, digits, spaces, hyphens and underscores and can be - * between 3 and 30 characters. This is captured by the regular expression: - * `[\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]`. - * The caller must have `resourcemanager.folders.update` permission on the - * identified folder. - * - * If the update fails due to the unique name constraint then a - * `PreconditionFailure` explaining this violation will be returned - * in the Status.details field. - * @param \Google\Cloud\ResourceManager\V3\UpdateFolderRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateFolder(\Google\Cloud\ResourceManager\V3\UpdateFolderRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/UpdateFolder', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Moves a folder under a new resource parent. - * Returns an `Operation` which can be used to track the progress of the - * folder move workflow. - * Upon success, the `Operation.response` field will be populated with the - * moved folder. - * Upon failure, a `FolderOperationError` categorizing the failure cause will - * be returned - if the failure occurs synchronously then the - * `FolderOperationError` will be returned in the `Status.details` field. - * If it occurs asynchronously, then the FolderOperation will be returned - * in the `Operation.error` field. - * In addition, the `Operation.metadata` field will be populated with a - * `FolderOperation` message as an aid to stateless clients. - * Folder moves will be rejected if they violate either the naming, height, - * or fanout constraints described in the - * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] - * documentation. The caller must have `resourcemanager.folders.move` - * permission on the folder's current and proposed new parent. - * @param \Google\Cloud\ResourceManager\V3\MoveFolderRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function MoveFolder(\Google\Cloud\ResourceManager\V3\MoveFolderRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/MoveFolder', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Requests deletion of a folder. The folder is moved into the - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] - * state immediately, and is deleted approximately 30 days later. This method - * may only be called on an empty folder, where a folder is empty if it - * doesn't contain any folders or projects in the - * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If - * called on a folder in - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] - * state the operation will result in a no-op success. - * The caller must have `resourcemanager.folders.delete` permission on the - * identified folder. - * @param \Google\Cloud\ResourceManager\V3\DeleteFolderRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteFolder(\Google\Cloud\ResourceManager\V3\DeleteFolderRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/DeleteFolder', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Cancels the deletion request for a folder. This method may be called on a - * folder in any state. If the folder is in the - * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the - * result will be a no-op success. In order to succeed, the folder's parent - * must be in the - * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In - * addition, reintroducing the folder into the tree must not violate folder - * naming, height, and fanout constraints described in the - * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] - * documentation. The caller must have `resourcemanager.folders.undelete` - * permission on the identified folder. - * @param \Google\Cloud\ResourceManager\V3\UndeleteFolderRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UndeleteFolder(\Google\Cloud\ResourceManager\V3\UndeleteFolderRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/UndeleteFolder', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets the access control policy for a folder. The returned policy may be - * empty if no such policy or resource exists. The `resource` field should - * be the folder's resource name, for example: "folders/1234". - * The caller must have `resourcemanager.folders.getIamPolicy` permission - * on the identified folder. - * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/GetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Sets the access control policy on a folder, replacing any existing policy. - * The `resource` field should be the folder's resource name, for example: - * "folders/1234". - * The caller must have `resourcemanager.folders.setIamPolicy` permission - * on the identified folder. - * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/SetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Returns permissions that a caller has on the specified folder. - * The `resource` field should be the folder's resource name, - * for example: "folders/1234". - * - * There are no permissions required for making this API call. - * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Folders/TestIamPermissions', - $argument, - ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetFolderRequest.php deleted file mode 100644 index 9eafd6494505..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetFolderRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.resourcemanager.v3.GetFolderRequest - */ -class GetFolderRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the folder to retrieve. - * Must be of the form `folders/{folder_id}`. - * - * 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 resource name of the folder to retrieve. - * Must be of the form `folders/{folder_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the folder to retrieve. - * Must be of the form `folders/{folder_id}`. - * - * 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 resource name of the folder to retrieve. - * Must be of the form `folders/{folder_id}`. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagKeyRequest.php deleted file mode 100644 index 496f2478f43a..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagKeyRequest.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.resourcemanager.v3.GetNamespacedTagKeyRequest - */ -class GetNamespacedTagKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A namespaced tag key name in the format - * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name - * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short - * name "bar" under the project `r2-d2`. - * - * 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. A namespaced tag key name in the format - * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name - * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short - * name "bar" under the project `r2-d2`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - - /** - * Required. A namespaced tag key name in the format - * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name - * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short - * name "bar" under the project `r2-d2`. - * - * 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. A namespaced tag key name in the format - * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name - * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short - * name "bar" under the project `r2-d2`. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagValueRequest.php deleted file mode 100644 index 945854f15b93..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetNamespacedTagValueRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.cloud.resourcemanager.v3.GetNamespacedTagValueRequest - */ -class GetNamespacedTagValueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A namespaced tag value name in the following format: - * `{parentId}/{tagKeyShort}/{tagValueShort}` - * Examples: - * - `42/foo/abc` for a value with short name "abc" under the key with short - * name "foo" under the organization with ID 42 - * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with - * short name "bar" under the project with ID "r2-d2" - * - * 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. A namespaced tag value name in the following format: - * `{parentId}/{tagKeyShort}/{tagValueShort}` - * Examples: - * - `42/foo/abc` for a value with short name "abc" under the key with short - * name "foo" under the organization with ID 42 - * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with - * short name "bar" under the project with ID "r2-d2" - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - - /** - * Required. A namespaced tag value name in the following format: - * `{parentId}/{tagKeyShort}/{tagValueShort}` - * Examples: - * - `42/foo/abc` for a value with short name "abc" under the key with short - * name "foo" under the organization with ID 42 - * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with - * short name "bar" under the project with ID "r2-d2" - * - * 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. A namespaced tag value name in the following format: - * `{parentId}/{tagKeyShort}/{tagValueShort}` - * Examples: - * - `42/foo/abc` for a value with short name "abc" under the key with short - * name "foo" under the organization with ID 42 - * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with - * short name "bar" under the project with ID "r2-d2" - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetOrganizationRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetOrganizationRequest.php deleted file mode 100644 index 3cf50c096eb7..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetOrganizationRequest.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.resourcemanager.v3.GetOrganizationRequest - */ -class GetOrganizationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the Organization to fetch. This is the - * organization's relative path in the API, formatted as - * "organizations/[organizationId]". For example, "organizations/1234". - * - * 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 resource name of the Organization to fetch. This is the - * organization's relative path in the API, formatted as - * "organizations/[organizationId]". For example, "organizations/1234". - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the Organization to fetch. This is the - * organization's relative path in the API, formatted as - * "organizations/[organizationId]". For example, "organizations/1234". - * - * 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 resource name of the Organization to fetch. This is the - * organization's relative path in the API, formatted as - * "organizations/[organizationId]". For example, "organizations/1234". - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetProjectRequest.php deleted file mode 100644 index 1cd344d81e30..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetProjectRequest.php +++ /dev/null @@ -1,69 +0,0 @@ -google.cloud.resourcemanager.v3.GetProjectRequest - */ -class GetProjectRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project (for example, `projects/415104041262`). - * - * 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 project (for example, `projects/415104041262`). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project (for example, `projects/415104041262`). - * - * 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 project (for example, `projects/415104041262`). - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagKeyRequest.php deleted file mode 100644 index e40147b894e8..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagKeyRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.resourcemanager.v3.GetTagKeyRequest - */ -class GetTagKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A resource name in the format `tagKeys/{id}`, such as - * `tagKeys/123`. - * - * 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. A resource name in the format `tagKeys/{id}`, such as - * `tagKeys/123`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - - /** - * Required. A resource name in the format `tagKeys/{id}`, such as - * `tagKeys/123`. - * - * 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. A resource name in the format `tagKeys/{id}`, such as - * `tagKeys/123`. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagValueRequest.php deleted file mode 100644 index 2521df4b391c..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/GetTagValueRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.resourcemanager.v3.GetTagValueRequest - */ -class GetTagValueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Resource name for TagValue to be fetched in the format - * `tagValues/456`. - * - * 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. Resource name for TagValue to be fetched in the format - * `tagValues/456`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - - /** - * Required. Resource name for TagValue to be fetched in the format - * `tagValues/456`. - * - * 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. Resource name for TagValue to be fetched in the format - * `tagValues/456`. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsRequest.php deleted file mode 100644 index e3ca4d2a48ba..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsRequest.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.resourcemanager.v3.ListEffectiveTagsRequest - */ -class ListEffectiveTagsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full resource name of a resource for which you want to list - * the effective tags. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - /** - * Optional. The maximum number of effective tags to return in the response. - * The server allows a maximum of 300 effective tags to return in a single - * page. If unspecified, the server will use 100 as the default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A pagination token returned from a previous call to - * `ListEffectiveTags` that indicates from where this listing should continue. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The full resource name of a resource for which you want to list - * the effective tags. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * @type int $page_size - * Optional. The maximum number of effective tags to return in the response. - * The server allows a maximum of 300 effective tags to return in a single - * page. If unspecified, the server will use 100 as the default. - * @type string $page_token - * Optional. A pagination token returned from a previous call to - * `ListEffectiveTags` that indicates from where this listing should continue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full resource name of a resource for which you want to list - * the effective tags. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The full resource name of a resource for which you want to list - * the effective tags. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of effective tags to return in the response. - * The server allows a maximum of 300 effective tags to return in a single - * page. If unspecified, the server will use 100 as the default. - * - * 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 effective tags to return in the response. - * The server allows a maximum of 300 effective tags to return in a single - * page. If unspecified, the server will use 100 as the default. - * - * 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. A pagination token returned from a previous call to - * `ListEffectiveTags` that indicates from where this listing should continue. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to - * `ListEffectiveTags` that indicates from where this listing should continue. - * - * 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; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsResponse.php deleted file mode 100644 index 8c970dbe1d03..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListEffectiveTagsResponse.php +++ /dev/null @@ -1,129 +0,0 @@ -google.cloud.resourcemanager.v3.ListEffectiveTagsResponse - */ -class ListEffectiveTagsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A possibly paginated list of effective tags for the specified resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.EffectiveTag effective_tags = 1; - */ - private $effective_tags; - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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\ResourceManager\V3\EffectiveTag>|\Google\Protobuf\Internal\RepeatedField $effective_tags - * A possibly paginated list of effective tags for the specified resource. - * @type string $next_page_token - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - - /** - * A possibly paginated list of effective tags for the specified resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.EffectiveTag effective_tags = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEffectiveTags() - { - return $this->effective_tags; - } - - /** - * A possibly paginated list of effective tags for the specified resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.EffectiveTag effective_tags = 1; - * @param array<\Google\Cloud\ResourceManager\V3\EffectiveTag>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEffectiveTags($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\EffectiveTag::class); - $this->effective_tags = $arr; - - return $this; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersRequest.php deleted file mode 100644 index a928f5732fd7..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersRequest.php +++ /dev/null @@ -1,213 +0,0 @@ -google.cloud.resourcemanager.v3.ListFoldersRequest - */ -class ListFoldersRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource whose folders are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * Access to this method is controlled by checking the - * `resourcemanager.folders.list` permission on the `parent`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of folders to return in the response. The - * server can return fewer folders than requested. If unspecified, server - * picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A pagination token returned from a previous call to `ListFolders` - * that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Controls whether folders in the - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] - * state should be returned. Defaults to false. - * - * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $show_deleted = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource whose folders are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * Access to this method is controlled by checking the - * `resourcemanager.folders.list` permission on the `parent`. - * @type int $page_size - * Optional. The maximum number of folders to return in the response. The - * server can return fewer folders than requested. If unspecified, server - * picks an appropriate default. - * @type string $page_token - * Optional. A pagination token returned from a previous call to `ListFolders` - * that indicates where this listing should continue from. - * @type bool $show_deleted - * Optional. Controls whether folders in the - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] - * state should be returned. Defaults to false. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource whose folders are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * Access to this method is controlled by checking the - * `resourcemanager.folders.list` permission on the `parent`. - * - * 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 name of the parent resource whose folders are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * Access to this method is controlled by checking the - * `resourcemanager.folders.list` permission on the `parent`. - * - * 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 folders to return in the response. The - * server can return fewer folders than requested. If unspecified, server - * picks an appropriate default. - * - * 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 folders to return in the response. The - * server can return fewer folders than requested. If unspecified, server - * picks an appropriate default. - * - * 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. A pagination token returned from a previous call to `ListFolders` - * that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to `ListFolders` - * that indicates where this listing should continue from. - * - * 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. Controls whether folders in the - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] - * state should be returned. Defaults to false. - * - * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getShowDeleted() - { - return $this->show_deleted; - } - - /** - * Optional. Controls whether folders in the - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] - * state should be returned. Defaults to false. - * - * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setShowDeleted($var) - { - GPBUtil::checkBool($var); - $this->show_deleted = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersResponse.php deleted file mode 100644 index 72d6127db518..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListFoldersResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.resourcemanager.v3.ListFoldersResponse - */ -class ListFoldersResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A possibly paginated list of folders that are direct descendants of - * the specified parent resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; - */ - private $folders; - /** - * A pagination token returned from a previous call to `ListFolders` - * that indicates from where listing should continue. - * - * 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\ResourceManager\V3\Folder>|\Google\Protobuf\Internal\RepeatedField $folders - * A possibly paginated list of folders that are direct descendants of - * the specified parent resource. - * @type string $next_page_token - * A pagination token returned from a previous call to `ListFolders` - * that indicates from where listing should continue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * A possibly paginated list of folders that are direct descendants of - * the specified parent resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFolders() - { - return $this->folders; - } - - /** - * A possibly paginated list of folders that are direct descendants of - * the specified parent resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; - * @param array<\Google\Cloud\ResourceManager\V3\Folder>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFolders($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Folder::class); - $this->folders = $arr; - - return $this; - } - - /** - * A pagination token returned from a previous call to `ListFolders` - * that indicates from where listing should continue. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A pagination token returned from a previous call to `ListFolders` - * that indicates from where listing should continue. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsRequest.php deleted file mode 100644 index 0efd11bc7918..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsRequest.php +++ /dev/null @@ -1,207 +0,0 @@ -google.cloud.resourcemanager.v3.ListProjectsRequest - */ -class ListProjectsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource whose projects are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. A pagination token returned from a previous call to - * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - * indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. The maximum number of projects to return in the response. - * The server can return fewer projects than requested. - * If unspecified, server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. Indicate that projects in the `DELETE_REQUESTED` state should - * also be returned. Normally only `ACTIVE` projects are returned. - * - * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $show_deleted = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource whose projects are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * @type string $page_token - * Optional. A pagination token returned from a previous call to - * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - * indicates from where listing should continue. - * @type int $page_size - * Optional. The maximum number of projects to return in the response. - * The server can return fewer projects than requested. - * If unspecified, server picks an appropriate default. - * @type bool $show_deleted - * Optional. Indicate that projects in the `DELETE_REQUESTED` state should - * also be returned. Normally only `ACTIVE` projects are returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource whose projects are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * - * 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 name of the parent resource whose projects are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * - * 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. A pagination token returned from a previous call to - * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - * indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to - * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - * indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.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 maximum number of projects to return in the response. - * The server can return fewer projects than requested. - * If unspecified, server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of projects to return in the response. - * The server can return fewer projects than requested. - * If unspecified, server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. Indicate that projects in the `DELETE_REQUESTED` state should - * also be returned. Normally only `ACTIVE` projects are returned. - * - * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getShowDeleted() - { - return $this->show_deleted; - } - - /** - * Optional. Indicate that projects in the `DELETE_REQUESTED` state should - * also be returned. Normally only `ACTIVE` projects are returned. - * - * Generated from protobuf field bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setShowDeleted($var) - { - GPBUtil::checkBool($var); - $this->show_deleted = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsResponse.php deleted file mode 100644 index 4714956716e4..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListProjectsResponse.php +++ /dev/null @@ -1,136 +0,0 @@ -google.cloud.resourcemanager.v3.ListProjectsResponse - */ -class ListProjectsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Projects under the parent. This list can be paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; - */ - private $projects; - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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\ResourceManager\V3\Project>|\Google\Protobuf\Internal\RepeatedField $projects - * The list of Projects under the parent. This list can be paginated. - * @type string $next_page_token - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * The list of Projects under the parent. This list can be paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProjects() - { - return $this->projects; - } - - /** - * The list of Projects under the parent. This list can be paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; - * @param array<\Google\Cloud\ResourceManager\V3\Project>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProjects($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Project::class); - $this->projects = $arr; - - return $this; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsRequest.php deleted file mode 100644 index 71f7a8f5745f..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsRequest.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.resourcemanager.v3.ListTagBindingsRequest - */ -class ListTagBindingsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full resource name of a resource for which you want to list - * existing TagBindings. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of TagBindings to return in the response. The - * server allows a maximum of 300 TagBindings to return. If unspecified, the - * server will use 100 as the default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A pagination token returned from a previous call to - * `ListTagBindings` that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The full resource name of a resource for which you want to list - * existing TagBindings. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * @type int $page_size - * Optional. The maximum number of TagBindings to return in the response. The - * server allows a maximum of 300 TagBindings to return. If unspecified, the - * server will use 100 as the default. - * @type string $page_token - * Optional. A pagination token returned from a previous call to - * `ListTagBindings` that indicates where this listing should continue from. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full resource name of a resource for which you want to list - * existing TagBindings. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * - * 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 full resource name of a resource for which you want to list - * existing TagBindings. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * - * 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 TagBindings to return in the response. The - * server allows a maximum of 300 TagBindings to return. If unspecified, the - * server will use 100 as the default. - * - * 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 TagBindings to return in the response. The - * server allows a maximum of 300 TagBindings to return. If unspecified, the - * server will use 100 as the default. - * - * 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. A pagination token returned from a previous call to - * `ListTagBindings` that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to - * `ListTagBindings` that indicates where this listing should continue from. - * - * 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; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsResponse.php deleted file mode 100644 index f71e67a1f327..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagBindingsResponse.php +++ /dev/null @@ -1,129 +0,0 @@ -google.cloud.resourcemanager.v3.ListTagBindingsResponse - */ -class ListTagBindingsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A possibly paginated list of TagBindings for the specified resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; - */ - private $tag_bindings; - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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\ResourceManager\V3\TagBinding>|\Google\Protobuf\Internal\RepeatedField $tag_bindings - * A possibly paginated list of TagBindings for the specified resource. - * @type string $next_page_token - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - - /** - * A possibly paginated list of TagBindings for the specified resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTagBindings() - { - return $this->tag_bindings; - } - - /** - * A possibly paginated list of TagBindings for the specified resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; - * @param array<\Google\Cloud\ResourceManager\V3\TagBinding>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTagBindings($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\TagBinding::class); - $this->tag_bindings = $arr; - - return $this; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsRequest.php deleted file mode 100644 index 0817ca7697ea..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsRequest.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.resourcemanager.v3.ListTagHoldsRequest - */ -class ListTagHoldsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the parent TagValue. Must be of the form: - * `tagValues/{tag-value-id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of TagHolds to return in the response. The - * server allows a maximum of 300 TagHolds to return. If unspecified, the - * server will use 100 as the default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A pagination token returned from a previous call to - * `ListTagHolds` that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Criteria used to select a subset of TagHolds parented by the - * TagValue to return. This field follows the syntax defined by aip.dev/160; - * the `holder` and `origin` fields are supported for filtering. Currently - * only `AND` syntax is supported. Some example queries are: - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - * * `origin = 35678234` - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group - * AND origin = 35678234` - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the parent TagValue. Must be of the form: - * `tagValues/{tag-value-id}`. - * @type int $page_size - * Optional. The maximum number of TagHolds to return in the response. The - * server allows a maximum of 300 TagHolds to return. If unspecified, the - * server will use 100 as the default. - * @type string $page_token - * Optional. A pagination token returned from a previous call to - * `ListTagHolds` that indicates where this listing should continue from. - * @type string $filter - * Optional. Criteria used to select a subset of TagHolds parented by the - * TagValue to return. This field follows the syntax defined by aip.dev/160; - * the `holder` and `origin` fields are supported for filtering. Currently - * only `AND` syntax is supported. Some example queries are: - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - * * `origin = 35678234` - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group - * AND origin = 35678234` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the parent TagValue. Must be of the form: - * `tagValues/{tag-value-id}`. - * - * 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 parent TagValue. Must be of the form: - * `tagValues/{tag-value-id}`. - * - * 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 TagHolds to return in the response. The - * server allows a maximum of 300 TagHolds to return. If unspecified, the - * server will use 100 as the default. - * - * 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 TagHolds to return in the response. The - * server allows a maximum of 300 TagHolds to return. If unspecified, the - * server will use 100 as the default. - * - * 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. A pagination token returned from a previous call to - * `ListTagHolds` that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to - * `ListTagHolds` that indicates where this listing should continue from. - * - * 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. Criteria used to select a subset of TagHolds parented by the - * TagValue to return. This field follows the syntax defined by aip.dev/160; - * the `holder` and `origin` fields are supported for filtering. Currently - * only `AND` syntax is supported. Some example queries are: - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - * * `origin = 35678234` - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group - * AND origin = 35678234` - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Criteria used to select a subset of TagHolds parented by the - * TagValue to return. This field follows the syntax defined by aip.dev/160; - * the `holder` and `origin` fields are supported for filtering. Currently - * only `AND` syntax is supported. Some example queries are: - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - * * `origin = 35678234` - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group - * AND origin = 35678234` - * - * 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; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsResponse.php deleted file mode 100644 index 8d12cbcf0492..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagHoldsResponse.php +++ /dev/null @@ -1,129 +0,0 @@ -google.cloud.resourcemanager.v3.ListTagHoldsResponse - */ -class ListTagHoldsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A possibly paginated list of TagHolds. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagHold tag_holds = 1; - */ - private $tag_holds; - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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\ResourceManager\V3\TagHold>|\Google\Protobuf\Internal\RepeatedField $tag_holds - * A possibly paginated list of TagHolds. - * @type string $next_page_token - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); - parent::__construct($data); - } - - /** - * A possibly paginated list of TagHolds. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagHold tag_holds = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTagHolds() - { - return $this->tag_holds; - } - - /** - * A possibly paginated list of TagHolds. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagHold tag_holds = 1; - * @param array<\Google\Cloud\ResourceManager\V3\TagHold>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTagHolds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\TagHold::class); - $this->tag_holds = $arr; - - return $this; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysRequest.php deleted file mode 100644 index e41be45ff994..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysRequest.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.resourcemanager.v3.ListTagKeysRequest - */ -class ListTagKeysRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the TagKey's parent. - * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or - * `projects/{project_number}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of TagKeys to return in the response. The - * server allows a maximum of 300 TagKeys to return. If unspecified, the - * server will use 100 as the default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A pagination token returned from a previous call to `ListTagKey` - * that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the TagKey's parent. - * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or - * `projects/{project_number}` - * @type int $page_size - * Optional. The maximum number of TagKeys to return in the response. The - * server allows a maximum of 300 TagKeys to return. If unspecified, the - * server will use 100 as the default. - * @type string $page_token - * Optional. A pagination token returned from a previous call to `ListTagKey` - * that indicates where this listing should continue from. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the TagKey's parent. - * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or - * `projects/{project_number}` - * - * 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 TagKey's parent. - * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or - * `projects/{project_number}` - * - * 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 TagKeys to return in the response. The - * server allows a maximum of 300 TagKeys to return. If unspecified, the - * server will use 100 as the default. - * - * 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 TagKeys to return in the response. The - * server allows a maximum of 300 TagKeys to return. If unspecified, the - * server will use 100 as the default. - * - * 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. A pagination token returned from a previous call to `ListTagKey` - * that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to `ListTagKey` - * that indicates where this listing should continue from. - * - * 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; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysResponse.php deleted file mode 100644 index ff989a9f578f..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagKeysResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.resourcemanager.v3.ListTagKeysResponse - */ -class ListTagKeysResponse extends \Google\Protobuf\Internal\Message -{ - /** - * List of TagKeys that live under the specified parent in the request. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; - */ - private $tag_keys; - /** - * A pagination token returned from a previous call to `ListTagKeys` - * that indicates from where listing should continue. - * - * 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\ResourceManager\V3\TagKey>|\Google\Protobuf\Internal\RepeatedField $tag_keys - * List of TagKeys that live under the specified parent in the request. - * @type string $next_page_token - * A pagination token returned from a previous call to `ListTagKeys` - * that indicates from where listing should continue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - - /** - * List of TagKeys that live under the specified parent in the request. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTagKeys() - { - return $this->tag_keys; - } - - /** - * List of TagKeys that live under the specified parent in the request. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; - * @param array<\Google\Cloud\ResourceManager\V3\TagKey>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTagKeys($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\TagKey::class); - $this->tag_keys = $arr; - - return $this; - } - - /** - * A pagination token returned from a previous call to `ListTagKeys` - * that indicates from where listing should continue. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A pagination token returned from a previous call to `ListTagKeys` - * that indicates from where listing should continue. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesRequest.php deleted file mode 100644 index 435deccc0b7d..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesRequest.php +++ /dev/null @@ -1,149 +0,0 @@ -google.cloud.resourcemanager.v3.ListTagValuesRequest - */ -class ListTagValuesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of TagValues to return in the response. The - * server allows a maximum of 300 TagValues to return. If unspecified, the - * server will use 100 as the default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A pagination token returned from a previous call to - * `ListTagValues` that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. - * @type int $page_size - * Optional. The maximum number of TagValues to return in the response. The - * server allows a maximum of 300 TagValues to return. If unspecified, the - * server will use 100 as the default. - * @type string $page_token - * Optional. A pagination token returned from a previous call to - * `ListTagValues` that indicates where this listing should continue from. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - - /** - * Required. - * - * 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. - * - * 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 TagValues to return in the response. The - * server allows a maximum of 300 TagValues to return. If unspecified, the - * server will use 100 as the default. - * - * 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 TagValues to return in the response. The - * server allows a maximum of 300 TagValues to return. If unspecified, the - * server will use 100 as the default. - * - * 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. A pagination token returned from a previous call to - * `ListTagValues` that indicates where this listing should continue from. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to - * `ListTagValues` that indicates where this listing should continue from. - * - * 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; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesResponse.php deleted file mode 100644 index ff490de7417a..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/ListTagValuesResponse.php +++ /dev/null @@ -1,113 +0,0 @@ -google.cloud.resourcemanager.v3.ListTagValuesResponse - */ -class ListTagValuesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A possibly paginated list of TagValues that are direct descendants of - * the specified parent TagKey. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; - */ - private $tag_values; - /** - * A pagination token returned from a previous call to `ListTagValues` - * that indicates from where listing should continue. This is currently not - * used, but the server may at any point start supplying a valid token. - * - * 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\ResourceManager\V3\TagValue>|\Google\Protobuf\Internal\RepeatedField $tag_values - * A possibly paginated list of TagValues that are direct descendants of - * the specified parent TagKey. - * @type string $next_page_token - * A pagination token returned from a previous call to `ListTagValues` - * that indicates from where listing should continue. This is currently not - * used, but the server may at any point start supplying a valid token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - - /** - * A possibly paginated list of TagValues that are direct descendants of - * the specified parent TagKey. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTagValues() - { - return $this->tag_values; - } - - /** - * A possibly paginated list of TagValues that are direct descendants of - * the specified parent TagKey. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; - * @param array<\Google\Cloud\ResourceManager\V3\TagValue>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTagValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\TagValue::class); - $this->tag_values = $arr; - - return $this; - } - - /** - * A pagination token returned from a previous call to `ListTagValues` - * that indicates from where listing should continue. This is currently not - * used, but the server may at any point start supplying a valid token. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A pagination token returned from a previous call to `ListTagValues` - * that indicates from where listing should continue. This is currently not - * used, but the server may at any point start supplying a valid token. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderMetadata.php deleted file mode 100644 index da8f8448b18a..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderMetadata.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.resourcemanager.v3.MoveFolderMetadata - */ -class MoveFolderMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The display name of the folder. - * - * Generated from protobuf field string display_name = 1; - */ - protected $display_name = ''; - /** - * The resource name of the folder's parent. - * - * Generated from protobuf field string source_parent = 2; - */ - protected $source_parent = ''; - /** - * The resource name of the folder or organization to move the folder to. - * - * Generated from protobuf field string destination_parent = 3; - */ - protected $destination_parent = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $display_name - * The display name of the folder. - * @type string $source_parent - * The resource name of the folder's parent. - * @type string $destination_parent - * The resource name of the folder or organization to move the folder to. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * The display name of the folder. - * - * Generated from protobuf field string display_name = 1; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * The display name of the folder. - * - * Generated from protobuf field string display_name = 1; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * The resource name of the folder's parent. - * - * Generated from protobuf field string source_parent = 2; - * @return string - */ - public function getSourceParent() - { - return $this->source_parent; - } - - /** - * The resource name of the folder's parent. - * - * Generated from protobuf field string source_parent = 2; - * @param string $var - * @return $this - */ - public function setSourceParent($var) - { - GPBUtil::checkString($var, True); - $this->source_parent = $var; - - return $this; - } - - /** - * The resource name of the folder or organization to move the folder to. - * - * Generated from protobuf field string destination_parent = 3; - * @return string - */ - public function getDestinationParent() - { - return $this->destination_parent; - } - - /** - * The resource name of the folder or organization to move the folder to. - * - * Generated from protobuf field string destination_parent = 3; - * @param string $var - * @return $this - */ - public function setDestinationParent($var) - { - GPBUtil::checkString($var, True); - $this->destination_parent = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderRequest.php deleted file mode 100644 index 0a3c7f37543d..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveFolderRequest.php +++ /dev/null @@ -1,113 +0,0 @@ -google.cloud.resourcemanager.v3.MoveFolderRequest - */ -class MoveFolderRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the Folder to move. - * Must be of the form folders/{folder_id} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The resource name of the folder or organization which should be - * the folder's new parent. Must be of the form `folders/{folder_id}` or - * `organizations/{org_id}`. - * - * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $destination_parent = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the Folder to move. - * Must be of the form folders/{folder_id} - * @type string $destination_parent - * Required. The resource name of the folder or organization which should be - * the folder's new parent. Must be of the form `folders/{folder_id}` or - * `organizations/{org_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the Folder to move. - * Must be of the form folders/{folder_id} - * - * 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 resource name of the Folder to move. - * Must be of the form folders/{folder_id} - * - * 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; - } - - /** - * Required. The resource name of the folder or organization which should be - * the folder's new parent. Must be of the form `folders/{folder_id}` or - * `organizations/{org_id}`. - * - * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getDestinationParent() - { - return $this->destination_parent; - } - - /** - * Required. The resource name of the folder or organization which should be - * the folder's new parent. Must be of the form `folders/{folder_id}` or - * `organizations/{org_id}`. - * - * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setDestinationParent($var) - { - GPBUtil::checkString($var, True); - $this->destination_parent = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectMetadata.php deleted file mode 100644 index 4dc990631f48..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.MoveProjectMetadata - */ -class MoveProjectMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectRequest.php deleted file mode 100644 index fa5ea46e2db8..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/MoveProjectRequest.php +++ /dev/null @@ -1,103 +0,0 @@ -google.cloud.resourcemanager.v3.MoveProjectRequest - */ -class MoveProjectRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project to move. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The new parent to move the Project under. - * - * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $destination_parent = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the project to move. - * @type string $destination_parent - * Required. The new parent to move the Project under. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project to move. - * - * 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 project to move. - * - * 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; - } - - /** - * Required. The new parent to move the Project under. - * - * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getDestinationParent() - { - return $this->destination_parent; - } - - /** - * Required. The new parent to move the Project under. - * - * Generated from protobuf field string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setDestinationParent($var) - { - GPBUtil::checkString($var, True); - $this->destination_parent = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization.php deleted file mode 100644 index d641338f6e82..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization.php +++ /dev/null @@ -1,372 +0,0 @@ -google.cloud.resourcemanager.v3.Organization - */ -class Organization extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name of the organization. This is the - * organization's relative path in the API. Its format is - * "organizations/[organization_id]". For example, "organizations/1234". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Output only. A human-readable string that refers to the organization in the - * Google Cloud Console. This string is set by the server and cannot be - * changed. The string will be set to the primary domain (for example, - * "google.com") of the Google Workspace customer that owns the organization. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $display_name = ''; - /** - * Output only. The organization's current lifecycle state. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. Timestamp when the Organization was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Timestamp when the Organization was last modified. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. Timestamp when the Organization was requested for deletion. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Output only. A checksum computed by the server based on the current value - * of the Organization resource. This may be sent on update and delete - * requests to ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $etag = ''; - protected $owner; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name of the organization. This is the - * organization's relative path in the API. Its format is - * "organizations/[organization_id]". For example, "organizations/1234". - * @type string $display_name - * Output only. A human-readable string that refers to the organization in the - * Google Cloud Console. This string is set by the server and cannot be - * changed. The string will be set to the primary domain (for example, - * "google.com") of the Google Workspace customer that owns the organization. - * @type string $directory_customer_id - * Immutable. The G Suite / Workspace customer id used in the Directory API. - * @type int $state - * Output only. The organization's current lifecycle state. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Timestamp when the Organization was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Timestamp when the Organization was last modified. - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. Timestamp when the Organization was requested for deletion. - * @type string $etag - * Output only. A checksum computed by the server based on the current value - * of the Organization resource. This may be sent on update and delete - * requests to ensure the client has an up-to-date value before proceeding. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name of the organization. This is the - * organization's relative path in the API. Its format is - * "organizations/[organization_id]". For example, "organizations/1234". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The resource name of the organization. This is the - * organization's relative path in the API. Its format is - * "organizations/[organization_id]". For example, "organizations/1234". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. A human-readable string that refers to the organization in the - * Google Cloud Console. This string is set by the server and cannot be - * changed. The string will be set to the primary domain (for example, - * "google.com") of the Google Workspace customer that owns the organization. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Output only. A human-readable string that refers to the organization in the - * Google Cloud Console. This string is set by the server and cannot be - * changed. The string will be set to the primary domain (for example, - * "google.com") of the Google Workspace customer that owns the organization. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Immutable. The G Suite / Workspace customer id used in the Directory API. - * - * Generated from protobuf field string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getDirectoryCustomerId() - { - return $this->readOneof(3); - } - - public function hasDirectoryCustomerId() - { - return $this->hasOneof(3); - } - - /** - * Immutable. The G Suite / Workspace customer id used in the Directory API. - * - * Generated from protobuf field string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setDirectoryCustomerId($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Output only. The organization's current lifecycle state. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The organization's current lifecycle state. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V3\Organization\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Timestamp when the Organization was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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. Timestamp when the Organization was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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. Timestamp when the Organization was last modified. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.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. Timestamp when the Organization was last modified. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.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. Timestamp when the Organization was requested for deletion. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. Timestamp when the Organization was requested for deletion. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Output only. A checksum computed by the server based on the current value - * of the Organization resource. This may be sent on update and delete - * requests to ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Output only. A checksum computed by the server based on the current value - * of the Organization resource. This may be sent on update and delete - * requests to ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * @return string - */ - public function getOwner() - { - return $this->whichOneof("owner"); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization/State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization/State.php deleted file mode 100644 index afee81887ea8..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization/State.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.resourcemanager.v3.Organization.State - */ -class State -{ - /** - * Unspecified state. This is only useful for distinguishing unset values. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The normal and active state. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * The organization has been marked for deletion by the user. - * - * Generated from protobuf enum DELETE_REQUESTED = 2; - */ - const DELETE_REQUESTED = 2; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::DELETE_REQUESTED => 'DELETE_REQUESTED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\ResourceManager\V3\Organization_State::class); - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization_State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization_State.php deleted file mode 100644 index 148af4e0c1e7..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Organization_State.php +++ /dev/null @@ -1,16 +0,0 @@ -_simpleRequest('/google.cloud.resourcemanager.v3.Organizations/GetOrganization', - $argument, - ['\Google\Cloud\ResourceManager\V3\Organization', 'decode'], - $metadata, $options); - } - - /** - * Searches organization resources that are visible to the user and satisfy - * the specified filter. This method returns organizations in an unspecified - * order. New organizations do not necessarily appear at the end of the - * results, and may take a small amount of time to appear. - * - * Search will only return organizations on which the user has the permission - * `resourcemanager.organizations.get` - * @param \Google\Cloud\ResourceManager\V3\SearchOrganizationsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SearchOrganizations(\Google\Cloud\ResourceManager\V3\SearchOrganizationsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Organizations/SearchOrganizations', - $argument, - ['\Google\Cloud\ResourceManager\V3\SearchOrganizationsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets the access control policy for an organization resource. The policy may - * be empty if no such policy or resource exists. The `resource` field should - * be the organization's resource name, for example: "organizations/123". - * - * Authorization requires the IAM permission - * `resourcemanager.organizations.getIamPolicy` on the specified organization. - * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Organizations/GetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Sets the access control policy on an organization resource. Replaces any - * existing policy. The `resource` field should be the organization's resource - * name, for example: "organizations/123". - * - * Authorization requires the IAM permission - * `resourcemanager.organizations.setIamPolicy` on the specified organization. - * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Organizations/SetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Returns the permissions that a caller has on the specified organization. - * The `resource` field should be the organization's resource name, - * for example: "organizations/123". - * - * There are no permissions required for making this API call. - * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Organizations/TestIamPermissions', - $argument, - ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project.php deleted file mode 100644 index 066d475cb2f9..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project.php +++ /dev/null @@ -1,489 +0,0 @@ -google.cloud.resourcemanager.v3.Project - */ -class Project extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The unique resource name of the project. It is an int64 - * generated number prefixed by "projects/". - * Example: `projects/415104041262` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Optional. A reference to a parent Resource. eg., `organizations/123` or - * `folders/876`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $parent = ''; - /** - * Immutable. The unique, user-assigned id of the project. - * It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. - * It must start with a letter. - * Trailing hyphens are prohibited. - * Example: `tokyo-rain-123` - * - * Generated from protobuf field string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $project_id = ''; - /** - * Output only. The project lifecycle state. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Optional. A user-assigned display name of the project. - * When present it must be between 4 to 30 characters. - * Allowed characters are: lowercase and uppercase letters, numbers, - * hyphen, single-quote, double-quote, space, and exclamation point. - * Example: `My Project` - * - * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $display_name = ''; - /** - * Output only. Creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The most recent time this resource was modified. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. The time at which this resource was requested for deletion. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $delete_time = null; - /** - * Output only. A checksum computed by the server based on the current value - * of the Project resource. This may be sent on update and delete requests to - * ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $etag = ''; - /** - * Optional. The labels associated with this project. - * Label keys must be between 1 and 63 characters long and must conform - * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. - * Label values must be between 0 and 63 characters long and must conform - * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. - * No more than 64 labels can be associated with a given resource. - * Clients should store labels in a representation such as JSON that does not - * depend on specific characters being disallowed. - * Example: `"myBusinessDimension" : "businessValue"` - * - * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The unique resource name of the project. It is an int64 - * generated number prefixed by "projects/". - * Example: `projects/415104041262` - * @type string $parent - * Optional. A reference to a parent Resource. eg., `organizations/123` or - * `folders/876`. - * @type string $project_id - * Immutable. The unique, user-assigned id of the project. - * It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. - * It must start with a letter. - * Trailing hyphens are prohibited. - * Example: `tokyo-rain-123` - * @type int $state - * Output only. The project lifecycle state. - * @type string $display_name - * Optional. A user-assigned display name of the project. - * When present it must be between 4 to 30 characters. - * Allowed characters are: lowercase and uppercase letters, numbers, - * hyphen, single-quote, double-quote, space, and exclamation point. - * Example: `My Project` - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Creation time. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The most recent time this resource was modified. - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. The time at which this resource was requested for deletion. - * @type string $etag - * Output only. A checksum computed by the server based on the current value - * of the Project resource. This may be sent on update and delete requests to - * ensure the client has an up-to-date value before proceeding. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. The labels associated with this project. - * Label keys must be between 1 and 63 characters long and must conform - * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. - * Label values must be between 0 and 63 characters long and must conform - * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. - * No more than 64 labels can be associated with a given resource. - * Clients should store labels in a representation such as JSON that does not - * depend on specific characters being disallowed. - * Example: `"myBusinessDimension" : "businessValue"` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The unique resource name of the project. It is an int64 - * generated number prefixed by "projects/". - * Example: `projects/415104041262` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The unique resource name of the project. It is an int64 - * generated number prefixed by "projects/". - * Example: `projects/415104041262` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A reference to a parent Resource. eg., `organizations/123` or - * `folders/876`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Optional. A reference to a parent Resource. eg., `organizations/123` or - * `folders/876`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Immutable. The unique, user-assigned id of the project. - * It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. - * It must start with a letter. - * Trailing hyphens are prohibited. - * Example: `tokyo-rain-123` - * - * Generated from protobuf field string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Immutable. The unique, user-assigned id of the project. - * It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. - * It must start with a letter. - * Trailing hyphens are prohibited. - * Example: `tokyo-rain-123` - * - * Generated from protobuf field string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Output only. The project lifecycle state. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The project lifecycle state. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V3\Project\State::class); - $this->state = $var; - - return $this; - } - - /** - * Optional. A user-assigned display name of the project. - * When present it must be between 4 to 30 characters. - * Allowed characters are: lowercase and uppercase letters, numbers, - * hyphen, single-quote, double-quote, space, and exclamation point. - * Example: `My Project` - * - * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Optional. A user-assigned display name of the project. - * When present it must be between 4 to 30 characters. - * Allowed characters are: lowercase and uppercase letters, numbers, - * hyphen, single-quote, double-quote, space, and exclamation point. - * Example: `My Project` - * - * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. Creation time. - * - * 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. Creation time. - * - * 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 most recent time this resource was modified. - * - * 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 most recent time this resource was modified. - * - * 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. The time at which this resource was requested for deletion. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. The time at which this resource was requested for deletion. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Output only. A checksum computed by the server based on the current value - * of the Project resource. This may be sent on update and delete requests to - * ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Output only. A checksum computed by the server based on the current value - * of the Project resource. This may be sent on update and delete requests to - * ensure the client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Optional. The labels associated with this project. - * Label keys must be between 1 and 63 characters long and must conform - * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. - * Label values must be between 0 and 63 characters long and must conform - * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. - * No more than 64 labels can be associated with a given resource. - * Clients should store labels in a representation such as JSON that does not - * depend on specific characters being disallowed. - * Example: `"myBusinessDimension" : "businessValue"` - * - * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. The labels associated with this project. - * Label keys must be between 1 and 63 characters long and must conform - * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. - * Label values must be between 0 and 63 characters long and must conform - * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. - * No more than 64 labels can be associated with a given resource. - * Clients should store labels in a representation such as JSON that does not - * depend on specific characters being disallowed. - * Example: `"myBusinessDimension" : "businessValue"` - * - * Generated from protobuf field map labels = 10 [(.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; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project/State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project/State.php deleted file mode 100644 index ce98594b31e5..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project/State.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.resourcemanager.v3.Project.State - */ -class State -{ - /** - * Unspecified state. This is only used/useful for distinguishing - * unset values. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The normal and active state. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * The project has been marked for deletion by the user - * (by invoking - * [DeleteProject][google.cloud.resourcemanager.v3.Projects.DeleteProject]) - * or by the system (Google Cloud Platform). - * This can generally be reversed by invoking [UndeleteProject] - * [google.cloud.resourcemanager.v3.Projects.UndeleteProject]. - * - * Generated from protobuf enum DELETE_REQUESTED = 2; - */ - const DELETE_REQUESTED = 2; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::DELETE_REQUESTED => 'DELETE_REQUESTED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\ResourceManager\V3\Project_State::class); - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project_State.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project_State.php deleted file mode 100644 index 7fd800c57905..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Project_State.php +++ /dev/null @@ -1,16 +0,0 @@ -_simpleRequest('/google.cloud.resourcemanager.v3.Projects/GetProject', - $argument, - ['\Google\Cloud\ResourceManager\V3\Project', 'decode'], - $metadata, $options); - } - - /** - * Lists projects that are direct children of the specified folder or - * organization resource. `list()` provides a strongly consistent view of the - * projects underneath the specified parent resource. `list()` returns - * projects sorted based upon the (ascending) lexical ordering of their - * `display_name`. The caller must have `resourcemanager.projects.list` - * permission on the identified parent. - * @param \Google\Cloud\ResourceManager\V3\ListProjectsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListProjects(\Google\Cloud\ResourceManager\V3\ListProjectsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/ListProjects', - $argument, - ['\Google\Cloud\ResourceManager\V3\ListProjectsResponse', 'decode'], - $metadata, $options); - } - - /** - * Search for projects that the caller has both `resourcemanager.projects.get` - * permission on, and also satisfy the specified query. - * - * This method returns projects in an unspecified order. - * - * This method is eventually consistent with project mutations; this means - * that a newly created project may not appear in the results or recent - * updates to an existing project may not be reflected in the results. To - * retrieve the latest state of a project, use the - * [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject] method. - * @param \Google\Cloud\ResourceManager\V3\SearchProjectsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SearchProjects(\Google\Cloud\ResourceManager\V3\SearchProjectsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/SearchProjects', - $argument, - ['\Google\Cloud\ResourceManager\V3\SearchProjectsResponse', 'decode'], - $metadata, $options); - } - - /** - * Request that a new project be created. The result is an `Operation` which - * can be used to track the creation process. This process usually takes a few - * seconds, but can sometimes take much longer. The tracking `Operation` is - * automatically deleted after a few hours, so there is no need to call - * `DeleteOperation`. - * @param \Google\Cloud\ResourceManager\V3\CreateProjectRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateProject(\Google\Cloud\ResourceManager\V3\CreateProjectRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/CreateProject', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the `display_name` and labels of the project identified by the - * specified `name` (for example, `projects/415104041262`). Deleting all - * labels requires an update mask for labels field. - * - * The caller must have `resourcemanager.projects.update` permission for this - * project. - * @param \Google\Cloud\ResourceManager\V3\UpdateProjectRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateProject(\Google\Cloud\ResourceManager\V3\UpdateProjectRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/UpdateProject', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Move a project to another place in your resource hierarchy, under a new - * resource parent. - * - * Returns an operation which can be used to track the process of the project - * move workflow. - * Upon success, the `Operation.response` field will be populated with the - * moved project. - * - * The caller must have `resourcemanager.projects.move` permission on the - * project, on the project's current and proposed new parent. - * - * If project has no current parent, or it currently does not have an - * associated organization resource, you will also need the - * `resourcemanager.projects.setIamPolicy` permission in the project. - * - * - * @param \Google\Cloud\ResourceManager\V3\MoveProjectRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function MoveProject(\Google\Cloud\ResourceManager\V3\MoveProjectRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/MoveProject', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Marks the project identified by the specified - * `name` (for example, `projects/415104041262`) for deletion. - * - * This method will only affect the project if it has a lifecycle state of - * [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE]. - * - * This method changes the Project's lifecycle state from - * [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] - * to - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. - * The deletion starts at an unspecified time, - * at which point the Project is no longer accessible. - * - * Until the deletion completes, you can check the lifecycle state - * checked by retrieving the project with [GetProject] - * [google.cloud.resourcemanager.v3.Projects.GetProject], - * and the project remains visible to [ListProjects] - * [google.cloud.resourcemanager.v3.Projects.ListProjects]. - * However, you cannot update the project. - * - * After the deletion completes, the project is not retrievable by - * the [GetProject] - * [google.cloud.resourcemanager.v3.Projects.GetProject], - * [ListProjects] - * [google.cloud.resourcemanager.v3.Projects.ListProjects], and - * [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] - * methods. - * - * This method behaves idempotently, such that deleting a `DELETE_REQUESTED` - * project will not cause an error, but also won't do anything. - * - * The caller must have `resourcemanager.projects.delete` permissions for this - * project. - * @param \Google\Cloud\ResourceManager\V3\DeleteProjectRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteProject(\Google\Cloud\ResourceManager\V3\DeleteProjectRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/DeleteProject', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Restores the project identified by the specified - * `name` (for example, `projects/415104041262`). - * You can only use this method for a project that has a lifecycle state of - * [DELETE_REQUESTED] - * [Projects.State.DELETE_REQUESTED]. - * After deletion starts, the project cannot be restored. - * - * The caller must have `resourcemanager.projects.undelete` permission for - * this project. - * @param \Google\Cloud\ResourceManager\V3\UndeleteProjectRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UndeleteProject(\Google\Cloud\ResourceManager\V3\UndeleteProjectRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/UndeleteProject', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Returns the IAM access control policy for the specified project, in the - * format `projects/{ProjectIdOrNumber}` e.g. projects/123. - * Permission is denied if the policy or the resource do not exist. - * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/GetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Sets the IAM access control policy for the specified project, in the - * format `projects/{ProjectIdOrNumber}` e.g. projects/123. - * - * CAUTION: This method will replace the existing policy, and cannot be used - * to append additional IAM settings. - * - * Note: Removing service accounts from policies or changing their roles can - * render services completely inoperable. It is important to understand how - * the service account is being used before removing or updating its roles. - * - * The following constraints apply when using `setIamPolicy()`: - * - * + Project does not support `allUsers` and `allAuthenticatedUsers` as - * `members` in a `Binding` of a `Policy`. - * - * + The owner role can be granted to a `user`, `serviceAccount`, or a group - * that is part of an organization. For example, - * group@myownpersonaldomain.com could be added as an owner to a project in - * the myownpersonaldomain.com organization, but not the examplepetstore.com - * organization. - * - * + Service accounts can be made owners of a project directly - * without any restrictions. However, to be added as an owner, a user must be - * invited using the Cloud Platform console and must accept the invitation. - * - * + A user cannot be granted the owner role using `setIamPolicy()`. The user - * must be granted the owner role using the Cloud Platform Console and must - * explicitly accept the invitation. - * - * + Invitations to grant the owner role cannot be sent using - * `setIamPolicy()`; - * they must be sent only using the Cloud Platform Console. - * - * + If the project is not part of an organization, there must be at least - * one owner who has accepted the Terms of Service (ToS) agreement in the - * policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner - * from the policy will fail. This restriction also applies to legacy - * projects that no longer have owners who have accepted the ToS. Edits to - * IAM policies will be rejected until the lack of a ToS-accepting owner is - * rectified. If the project is part of an organization, you can remove all - * owners, potentially making the organization inaccessible. - * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/SetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Returns permissions that a caller has on the specified project, in the - * format `projects/{ProjectIdOrNumber}` e.g. projects/123.. - * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.Projects/TestIamPermissions', - $argument, - ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Purpose.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Purpose.php deleted file mode 100644 index 77092359f1d1..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/Purpose.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.resourcemanager.v3.Purpose - */ -class Purpose -{ - /** - * Unspecified purpose. - * - * Generated from protobuf enum PURPOSE_UNSPECIFIED = 0; - */ - const PURPOSE_UNSPECIFIED = 0; - /** - * Purpose for Compute Engine firewalls. - * A corresponding `purpose_data` should be set for the network the tag is - * intended for. The key should be `network` and the value should be in - * either of these two formats: - * - - * `https://www.googleapis.com/compute/{compute_version}/projects/{project_id}/global/networks/{network_id}` - * - `{project_id}/{network_name}` - * Examples: - * - - * `https://www.googleapis.com/compute/staging_v1/projects/fail-closed-load-testing/global/networks/6992953698831725600` - * - `fail-closed-load-testing/load-testing-network` - * - * Generated from protobuf enum GCE_FIREWALL = 1; - */ - const GCE_FIREWALL = 1; - - private static $valueToName = [ - self::PURPOSE_UNSPECIFIED => 'PURPOSE_UNSPECIFIED', - self::GCE_FIREWALL => 'GCE_FIREWALL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersRequest.php deleted file mode 100644 index d128a1023c2a..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersRequest.php +++ /dev/null @@ -1,247 +0,0 @@ -google.cloud.resourcemanager.v3.SearchFoldersRequest - */ -class SearchFoldersRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The maximum number of folders to return in the response. The - * server can return fewer folders than requested. If unspecified, server - * picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A pagination token returned from a previous call to - * `SearchFolders` that indicates from where search should continue. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Search criteria used to select the folders to return. - * If no search criteria is specified then all accessible folders will be - * returned. - * Query expressions can be used to restrict results based upon displayName, - * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` - * can be used along with the suffix wildcard symbol `*`. - * The `displayName` field in a query expression should use escaped quotes - * for values that include whitespace to prevent unexpected behavior. - * ``` - * | Field | Description | - * |-------------------------|----------------------------------------| - * | displayName | Filters by displayName. | - * | parent | Filters by parent (for example: folders/123). | - * | state, lifecycleState | Filters by state. | - * ``` - * Some example queries are: - * * Query `displayName=Test*` returns Folder resources whose display name - * starts with "Test". - * * Query `state=ACTIVE` returns Folder resources with - * `state` set to `ACTIVE`. - * * Query `parent=folders/123` returns Folder resources that have - * `folders/123` as a parent resource. - * * Query `parent=folders/123 AND state=ACTIVE` returns active - * Folder resources that have `folders/123` as a parent resource. - * * Query `displayName=\\"Test String\\"` returns Folder resources with - * display names that include both "Test" and "String". - * - * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $query = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $page_size - * Optional. The maximum number of folders to return in the response. The - * server can return fewer folders than requested. If unspecified, server - * picks an appropriate default. - * @type string $page_token - * Optional. A pagination token returned from a previous call to - * `SearchFolders` that indicates from where search should continue. - * @type string $query - * Optional. Search criteria used to select the folders to return. - * If no search criteria is specified then all accessible folders will be - * returned. - * Query expressions can be used to restrict results based upon displayName, - * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` - * can be used along with the suffix wildcard symbol `*`. - * The `displayName` field in a query expression should use escaped quotes - * for values that include whitespace to prevent unexpected behavior. - * ``` - * | Field | Description | - * |-------------------------|----------------------------------------| - * | displayName | Filters by displayName. | - * | parent | Filters by parent (for example: folders/123). | - * | state, lifecycleState | Filters by state. | - * ``` - * Some example queries are: - * * Query `displayName=Test*` returns Folder resources whose display name - * starts with "Test". - * * Query `state=ACTIVE` returns Folder resources with - * `state` set to `ACTIVE`. - * * Query `parent=folders/123` returns Folder resources that have - * `folders/123` as a parent resource. - * * Query `parent=folders/123 AND state=ACTIVE` returns active - * Folder resources that have `folders/123` as a parent resource. - * * Query `displayName=\\"Test String\\"` returns Folder resources with - * display names that include both "Test" and "String". - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The maximum number of folders to return in the response. The - * server can return fewer folders than requested. If unspecified, server - * picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of folders to return in the response. The - * server can return fewer folders than requested. If unspecified, server - * picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A pagination token returned from a previous call to - * `SearchFolders` that indicates from where search should continue. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to - * `SearchFolders` that indicates from where search should continue. - * - * Generated from protobuf field string page_token = 2 [(.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. Search criteria used to select the folders to return. - * If no search criteria is specified then all accessible folders will be - * returned. - * Query expressions can be used to restrict results based upon displayName, - * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` - * can be used along with the suffix wildcard symbol `*`. - * The `displayName` field in a query expression should use escaped quotes - * for values that include whitespace to prevent unexpected behavior. - * ``` - * | Field | Description | - * |-------------------------|----------------------------------------| - * | displayName | Filters by displayName. | - * | parent | Filters by parent (for example: folders/123). | - * | state, lifecycleState | Filters by state. | - * ``` - * Some example queries are: - * * Query `displayName=Test*` returns Folder resources whose display name - * starts with "Test". - * * Query `state=ACTIVE` returns Folder resources with - * `state` set to `ACTIVE`. - * * Query `parent=folders/123` returns Folder resources that have - * `folders/123` as a parent resource. - * * Query `parent=folders/123 AND state=ACTIVE` returns active - * Folder resources that have `folders/123` as a parent resource. - * * Query `displayName=\\"Test String\\"` returns Folder resources with - * display names that include both "Test" and "String". - * - * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * Optional. Search criteria used to select the folders to return. - * If no search criteria is specified then all accessible folders will be - * returned. - * Query expressions can be used to restrict results based upon displayName, - * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` - * can be used along with the suffix wildcard symbol `*`. - * The `displayName` field in a query expression should use escaped quotes - * for values that include whitespace to prevent unexpected behavior. - * ``` - * | Field | Description | - * |-------------------------|----------------------------------------| - * | displayName | Filters by displayName. | - * | parent | Filters by parent (for example: folders/123). | - * | state, lifecycleState | Filters by state. | - * ``` - * Some example queries are: - * * Query `displayName=Test*` returns Folder resources whose display name - * starts with "Test". - * * Query `state=ACTIVE` returns Folder resources with - * `state` set to `ACTIVE`. - * * Query `parent=folders/123` returns Folder resources that have - * `folders/123` as a parent resource. - * * Query `parent=folders/123 AND state=ACTIVE` returns active - * Folder resources that have `folders/123` as a parent resource. - * * Query `displayName=\\"Test String\\"` returns Folder resources with - * display names that include both "Test" and "String". - * - * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersResponse.php deleted file mode 100644 index 39fe82fe3719..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchFoldersResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.resourcemanager.v3.SearchFoldersResponse - */ -class SearchFoldersResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A possibly paginated folder search results. - * the specified parent resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; - */ - private $folders; - /** - * A pagination token returned from a previous call to `SearchFolders` - * that indicates from where searching should continue. - * - * 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\ResourceManager\V3\Folder>|\Google\Protobuf\Internal\RepeatedField $folders - * A possibly paginated folder search results. - * the specified parent resource. - * @type string $next_page_token - * A pagination token returned from a previous call to `SearchFolders` - * that indicates from where searching should continue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * A possibly paginated folder search results. - * the specified parent resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFolders() - { - return $this->folders; - } - - /** - * A possibly paginated folder search results. - * the specified parent resource. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Folder folders = 1; - * @param array<\Google\Cloud\ResourceManager\V3\Folder>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFolders($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Folder::class); - $this->folders = $arr; - - return $this; - } - - /** - * A pagination token returned from a previous call to `SearchFolders` - * that indicates from where searching should continue. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A pagination token returned from a previous call to `SearchFolders` - * that indicates from where searching should continue. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsRequest.php deleted file mode 100644 index 8b23123ccbee..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsRequest.php +++ /dev/null @@ -1,203 +0,0 @@ -google.cloud.resourcemanager.v3.SearchOrganizationsRequest - */ -class SearchOrganizationsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The maximum number of organizations to return in the response. - * The server can return fewer organizations than requested. If unspecified, - * server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A pagination token returned from a previous call to - * `SearchOrganizations` that indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. An optional query string used to filter the Organizations to - * return in the response. Query rules are case-insensitive. - * ``` - * | Field | Description | - * |------------------|--------------------------------------------| - * | directoryCustomerId, owner.directoryCustomerId | Filters by directory - * customer id. | - * | domain | Filters by domain. | - * ``` - * Organizations may be queried by `directoryCustomerId` or by - * `domain`, where the domain is a G Suite domain, for example: - * * Query `directorycustomerid:123456789` returns Organization - * resources with `owner.directory_customer_id` equal to `123456789`. - * * Query `domain:google.com` returns Organization resources corresponding - * to the domain `google.com`. - * - * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $query = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $page_size - * Optional. The maximum number of organizations to return in the response. - * The server can return fewer organizations than requested. If unspecified, - * server picks an appropriate default. - * @type string $page_token - * Optional. A pagination token returned from a previous call to - * `SearchOrganizations` that indicates from where listing should continue. - * @type string $query - * Optional. An optional query string used to filter the Organizations to - * return in the response. Query rules are case-insensitive. - * ``` - * | Field | Description | - * |------------------|--------------------------------------------| - * | directoryCustomerId, owner.directoryCustomerId | Filters by directory - * customer id. | - * | domain | Filters by domain. | - * ``` - * Organizations may be queried by `directoryCustomerId` or by - * `domain`, where the domain is a G Suite domain, for example: - * * Query `directorycustomerid:123456789` returns Organization - * resources with `owner.directory_customer_id` equal to `123456789`. - * * Query `domain:google.com` returns Organization resources corresponding - * to the domain `google.com`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The maximum number of organizations to return in the response. - * The server can return fewer organizations than requested. If unspecified, - * server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of organizations to return in the response. - * The server can return fewer organizations than requested. If unspecified, - * server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A pagination token returned from a previous call to - * `SearchOrganizations` that indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to - * `SearchOrganizations` that indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.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. An optional query string used to filter the Organizations to - * return in the response. Query rules are case-insensitive. - * ``` - * | Field | Description | - * |------------------|--------------------------------------------| - * | directoryCustomerId, owner.directoryCustomerId | Filters by directory - * customer id. | - * | domain | Filters by domain. | - * ``` - * Organizations may be queried by `directoryCustomerId` or by - * `domain`, where the domain is a G Suite domain, for example: - * * Query `directorycustomerid:123456789` returns Organization - * resources with `owner.directory_customer_id` equal to `123456789`. - * * Query `domain:google.com` returns Organization resources corresponding - * to the domain `google.com`. - * - * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * Optional. An optional query string used to filter the Organizations to - * return in the response. Query rules are case-insensitive. - * ``` - * | Field | Description | - * |------------------|--------------------------------------------| - * | directoryCustomerId, owner.directoryCustomerId | Filters by directory - * customer id. | - * | domain | Filters by domain. | - * ``` - * Organizations may be queried by `directoryCustomerId` or by - * `domain`, where the domain is a G Suite domain, for example: - * * Query `directorycustomerid:123456789` returns Organization - * resources with `owner.directory_customer_id` equal to `123456789`. - * * Query `domain:google.com` returns Organization resources corresponding - * to the domain `google.com`. - * - * Generated from protobuf field string query = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsResponse.php deleted file mode 100644 index 74823ebb56d8..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchOrganizationsResponse.php +++ /dev/null @@ -1,121 +0,0 @@ -google.cloud.resourcemanager.v3.SearchOrganizationsResponse - */ -class SearchOrganizationsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Organizations that matched the search query, possibly - * paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; - */ - private $organizations; - /** - * A pagination token to be used to retrieve the next page of results. If the - * result is too large to fit within the page size specified in the request, - * this field will be set with a token that can be used to fetch the next page - * of results. If this field is empty, it indicates that this response - * contains the last page of results. - * - * 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\ResourceManager\V3\Organization>|\Google\Protobuf\Internal\RepeatedField $organizations - * The list of Organizations that matched the search query, possibly - * paginated. - * @type string $next_page_token - * A pagination token to be used to retrieve the next page of results. If the - * result is too large to fit within the page size specified in the request, - * this field will be set with a token that can be used to fetch the next page - * of results. If this field is empty, it indicates that this response - * contains the last page of results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); - parent::__construct($data); - } - - /** - * The list of Organizations that matched the search query, possibly - * paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getOrganizations() - { - return $this->organizations; - } - - /** - * The list of Organizations that matched the search query, possibly - * paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; - * @param array<\Google\Cloud\ResourceManager\V3\Organization>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setOrganizations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Organization::class); - $this->organizations = $arr; - - return $this; - } - - /** - * A pagination token to be used to retrieve the next page of results. If the - * result is too large to fit within the page size specified in the request, - * this field will be set with a token that can be used to fetch the next page - * of results. If this field is empty, it indicates that this response - * contains the last page of results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A pagination token to be used to retrieve the next page of results. If the - * result is too large to fit within the page size specified in the request, - * this field will be set with a token that can be used to fetch the next page - * of results. If this field is empty, it indicates that this response - * contains the last page of results. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsRequest.php deleted file mode 100644 index 1194941630f0..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsRequest.php +++ /dev/null @@ -1,257 +0,0 @@ -google.cloud.resourcemanager.v3.SearchProjectsRequest - */ -class SearchProjectsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. A query string for searching for projects that the caller has - * `resourcemanager.projects.get` permission to. If multiple fields are - * included in the query, then it will return results that match any of the - * fields. Some eligible fields are: - * - **`displayName`, `name`**: Filters by displayName. - * - **`parent`**: Project's parent (for example: `folders/123`, - * `organizations/*`). Prefer `parent` field over `parent.type` and - * `parent.id`. - * - **`parent.type`**: Parent's type: `folder` or `organization`. - * - **`parent.id`**: Parent's id number (for example: `123`). - * - **`id`, `projectId`**: Filters by projectId. - * - **`state`, `lifecycleState`**: Filters by state. - * - **`labels`**: Filters by label name or value. - * - **`labels.` (where `` is the name of a label)**: Filters by label - * name. - * Search expressions are case insensitive. - * Some examples queries: - * - **`name:how*`**: The project's name starts with "how". - * - **`name:Howl`**: The project's name is `Howl` or `howl`. - * - **`name:HOWL`**: Equivalent to above. - * - **`NAME:howl`**: Equivalent to above. - * - **`labels.color:*`**: The project has the label `color`. - * - **`labels.color:red`**: The project's label `color` has the value `red`. - * - **`labels.color:red labels.size:big`**: The project's label `color` has - * the value `red` or its label `size` has the value `big`. - * If no query is specified, the call will return projects for which the user - * has the `resourcemanager.projects.get` permission. - * - * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $query = ''; - /** - * Optional. A pagination token returned from a previous call to - * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - * indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. The maximum number of projects to return in the response. - * The server can return fewer projects than requested. - * If unspecified, server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $query - * Optional. A query string for searching for projects that the caller has - * `resourcemanager.projects.get` permission to. If multiple fields are - * included in the query, then it will return results that match any of the - * fields. Some eligible fields are: - * - **`displayName`, `name`**: Filters by displayName. - * - **`parent`**: Project's parent (for example: `folders/123`, - * `organizations/*`). Prefer `parent` field over `parent.type` and - * `parent.id`. - * - **`parent.type`**: Parent's type: `folder` or `organization`. - * - **`parent.id`**: Parent's id number (for example: `123`). - * - **`id`, `projectId`**: Filters by projectId. - * - **`state`, `lifecycleState`**: Filters by state. - * - **`labels`**: Filters by label name or value. - * - **`labels.` (where `` is the name of a label)**: Filters by label - * name. - * Search expressions are case insensitive. - * Some examples queries: - * - **`name:how*`**: The project's name starts with "how". - * - **`name:Howl`**: The project's name is `Howl` or `howl`. - * - **`name:HOWL`**: Equivalent to above. - * - **`NAME:howl`**: Equivalent to above. - * - **`labels.color:*`**: The project has the label `color`. - * - **`labels.color:red`**: The project's label `color` has the value `red`. - * - **`labels.color:red labels.size:big`**: The project's label `color` has - * the value `red` or its label `size` has the value `big`. - * If no query is specified, the call will return projects for which the user - * has the `resourcemanager.projects.get` permission. - * @type string $page_token - * Optional. A pagination token returned from a previous call to - * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - * indicates from where listing should continue. - * @type int $page_size - * Optional. The maximum number of projects to return in the response. - * The server can return fewer projects than requested. - * If unspecified, server picks an appropriate default. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Optional. A query string for searching for projects that the caller has - * `resourcemanager.projects.get` permission to. If multiple fields are - * included in the query, then it will return results that match any of the - * fields. Some eligible fields are: - * - **`displayName`, `name`**: Filters by displayName. - * - **`parent`**: Project's parent (for example: `folders/123`, - * `organizations/*`). Prefer `parent` field over `parent.type` and - * `parent.id`. - * - **`parent.type`**: Parent's type: `folder` or `organization`. - * - **`parent.id`**: Parent's id number (for example: `123`). - * - **`id`, `projectId`**: Filters by projectId. - * - **`state`, `lifecycleState`**: Filters by state. - * - **`labels`**: Filters by label name or value. - * - **`labels.` (where `` is the name of a label)**: Filters by label - * name. - * Search expressions are case insensitive. - * Some examples queries: - * - **`name:how*`**: The project's name starts with "how". - * - **`name:Howl`**: The project's name is `Howl` or `howl`. - * - **`name:HOWL`**: Equivalent to above. - * - **`NAME:howl`**: Equivalent to above. - * - **`labels.color:*`**: The project has the label `color`. - * - **`labels.color:red`**: The project's label `color` has the value `red`. - * - **`labels.color:red labels.size:big`**: The project's label `color` has - * the value `red` or its label `size` has the value `big`. - * If no query is specified, the call will return projects for which the user - * has the `resourcemanager.projects.get` permission. - * - * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * Optional. A query string for searching for projects that the caller has - * `resourcemanager.projects.get` permission to. If multiple fields are - * included in the query, then it will return results that match any of the - * fields. Some eligible fields are: - * - **`displayName`, `name`**: Filters by displayName. - * - **`parent`**: Project's parent (for example: `folders/123`, - * `organizations/*`). Prefer `parent` field over `parent.type` and - * `parent.id`. - * - **`parent.type`**: Parent's type: `folder` or `organization`. - * - **`parent.id`**: Parent's id number (for example: `123`). - * - **`id`, `projectId`**: Filters by projectId. - * - **`state`, `lifecycleState`**: Filters by state. - * - **`labels`**: Filters by label name or value. - * - **`labels.` (where `` is the name of a label)**: Filters by label - * name. - * Search expressions are case insensitive. - * Some examples queries: - * - **`name:how*`**: The project's name starts with "how". - * - **`name:Howl`**: The project's name is `Howl` or `howl`. - * - **`name:HOWL`**: Equivalent to above. - * - **`NAME:howl`**: Equivalent to above. - * - **`labels.color:*`**: The project has the label `color`. - * - **`labels.color:red`**: The project's label `color` has the value `red`. - * - **`labels.color:red labels.size:big`**: The project's label `color` has - * the value `red` or its label `size` has the value `big`. - * If no query is specified, the call will return projects for which the user - * has the `resourcemanager.projects.get` permission. - * - * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - - /** - * Optional. A pagination token returned from a previous call to - * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - * indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A pagination token returned from a previous call to - * [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - * indicates from where listing should continue. - * - * Generated from protobuf field string page_token = 2 [(.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 maximum number of projects to return in the response. - * The server can return fewer projects than requested. - * If unspecified, server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of projects to return in the response. - * The server can return fewer projects than requested. - * If unspecified, server picks an appropriate default. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsResponse.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsResponse.php deleted file mode 100644 index 3e3f0aaddf9a..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/SearchProjectsResponse.php +++ /dev/null @@ -1,138 +0,0 @@ -google.cloud.resourcemanager.v3.SearchProjectsResponse - */ -class SearchProjectsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Projects that matched the list filter query. This list can - * be paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; - */ - private $projects; - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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\ResourceManager\V3\Project>|\Google\Protobuf\Internal\RepeatedField $projects - * The list of Projects that matched the list filter query. This list can - * be paginated. - * @type string $next_page_token - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * The list of Projects that matched the list filter query. This list can - * be paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProjects() - { - return $this->projects; - } - - /** - * The list of Projects that matched the list filter query. This list can - * be paginated. - * - * Generated from protobuf field repeated .google.cloud.resourcemanager.v3.Project projects = 1; - * @param array<\Google\Cloud\ResourceManager\V3\Project>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProjects($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ResourceManager\V3\Project::class); - $this->projects = $arr; - - return $this; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Pagination token. - * If the result set is too large to fit in a single response, this token - * is returned. It encodes the position of the current result cursor. - * Feeding this value into a new list request with the `page_token` parameter - * gives the next page of the results. - * When `next_page_token` is not filled in, there is no next page and - * the list returned is the last page in the result set. - * Pagination tokens have a limited lifetime. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBinding.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBinding.php deleted file mode 100644 index 217deee78cb4..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBinding.php +++ /dev/null @@ -1,207 +0,0 @@ -google.cloud.resourcemanager.v3.TagBinding - */ -class TagBinding extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The name of the TagBinding. This is a String of the form: - * `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * The full resource name of the resource the TagValue is bound to. - * E.g. `//cloudresourcemanager.googleapis.com/projects/123` - * - * Generated from protobuf field string parent = 2; - */ - protected $parent = ''; - /** - * The TagValue of the TagBinding. - * Must be of the form `tagValues/456`. - * - * Generated from protobuf field string tag_value = 3; - */ - protected $tag_value = ''; - /** - * The namespaced name for the TagValue of the TagBinding. - * Must be in the format - * `{parent_id}/{tag_key_short_name}/{short_name}`. - * For methods that support TagValue namespaced name, only one of - * tag_value_namespaced_name or tag_value may be filled. Requests with both - * fields will be rejected. - * - * Generated from protobuf field string tag_value_namespaced_name = 4; - */ - protected $tag_value_namespaced_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The name of the TagBinding. This is a String of the form: - * `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - * @type string $parent - * The full resource name of the resource the TagValue is bound to. - * E.g. `//cloudresourcemanager.googleapis.com/projects/123` - * @type string $tag_value - * The TagValue of the TagBinding. - * Must be of the form `tagValues/456`. - * @type string $tag_value_namespaced_name - * The namespaced name for the TagValue of the TagBinding. - * Must be in the format - * `{parent_id}/{tag_key_short_name}/{short_name}`. - * For methods that support TagValue namespaced name, only one of - * tag_value_namespaced_name or tag_value may be filled. Requests with both - * fields will be rejected. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagBindings::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The name of the TagBinding. This is a String of the form: - * `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The name of the TagBinding. This is a String of the form: - * `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The full resource name of the resource the TagValue is bound to. - * E.g. `//cloudresourcemanager.googleapis.com/projects/123` - * - * Generated from protobuf field string parent = 2; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The full resource name of the resource the TagValue is bound to. - * E.g. `//cloudresourcemanager.googleapis.com/projects/123` - * - * Generated from protobuf field string parent = 2; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The TagValue of the TagBinding. - * Must be of the form `tagValues/456`. - * - * Generated from protobuf field string tag_value = 3; - * @return string - */ - public function getTagValue() - { - return $this->tag_value; - } - - /** - * The TagValue of the TagBinding. - * Must be of the form `tagValues/456`. - * - * Generated from protobuf field string tag_value = 3; - * @param string $var - * @return $this - */ - public function setTagValue($var) - { - GPBUtil::checkString($var, True); - $this->tag_value = $var; - - return $this; - } - - /** - * The namespaced name for the TagValue of the TagBinding. - * Must be in the format - * `{parent_id}/{tag_key_short_name}/{short_name}`. - * For methods that support TagValue namespaced name, only one of - * tag_value_namespaced_name or tag_value may be filled. Requests with both - * fields will be rejected. - * - * Generated from protobuf field string tag_value_namespaced_name = 4; - * @return string - */ - public function getTagValueNamespacedName() - { - return $this->tag_value_namespaced_name; - } - - /** - * The namespaced name for the TagValue of the TagBinding. - * Must be in the format - * `{parent_id}/{tag_key_short_name}/{short_name}`. - * For methods that support TagValue namespaced name, only one of - * tag_value_namespaced_name or tag_value may be filled. Requests with both - * fields will be rejected. - * - * Generated from protobuf field string tag_value_namespaced_name = 4; - * @param string $var - * @return $this - */ - public function setTagValueNamespacedName($var) - { - GPBUtil::checkString($var, True); - $this->tag_value_namespaced_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBindingsGrpcClient.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBindingsGrpcClient.php deleted file mode 100644 index ab94e4e1c165..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagBindingsGrpcClient.php +++ /dev/null @@ -1,101 +0,0 @@ -_simpleRequest('/google.cloud.resourcemanager.v3.TagBindings/ListTagBindings', - $argument, - ['\Google\Cloud\ResourceManager\V3\ListTagBindingsResponse', 'decode'], - $metadata, $options); - } - - /** - * Creates a TagBinding between a TagValue and a Google Cloud resource. - * @param \Google\Cloud\ResourceManager\V3\CreateTagBindingRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTagBinding(\Google\Cloud\ResourceManager\V3\CreateTagBindingRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagBindings/CreateTagBinding', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a TagBinding. - * @param \Google\Cloud\ResourceManager\V3\DeleteTagBindingRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTagBinding(\Google\Cloud\ResourceManager\V3\DeleteTagBindingRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagBindings/DeleteTagBinding', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Return a list of effective tags for the given Google Cloud resource, as - * specified in `parent`. - * @param \Google\Cloud\ResourceManager\V3\ListEffectiveTagsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListEffectiveTags(\Google\Cloud\ResourceManager\V3\ListEffectiveTagsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagBindings/ListEffectiveTags', - $argument, - ['\Google\Cloud\ResourceManager\V3\ListEffectiveTagsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHold.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHold.php deleted file mode 100644 index 7e2ee136616a..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHold.php +++ /dev/null @@ -1,256 +0,0 @@ -google.cloud.resourcemanager.v3.TagHold - */ -class TagHold extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name of a TagHold. This is a String of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` - * (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by - * the server. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Required. The name of the resource where the TagValue is being used. Must - * be less than 200 characters. E.g. - * `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - * - * Generated from protobuf field string holder = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $holder = ''; - /** - * Optional. An optional string representing the origin of this request. This - * field should include human-understandable information to distinguish - * origins from each other. Must be less than 200 characters. E.g. - * `migs-35678234` - * - * Generated from protobuf field string origin = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $origin = ''; - /** - * Optional. A URL where an end user can learn more about removing this hold. - * E.g. - * `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` - * - * Generated from protobuf field string help_link = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $help_link = ''; - /** - * Output only. The time this TagHold was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name of a TagHold. This is a String of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` - * (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by - * the server. - * @type string $holder - * Required. The name of the resource where the TagValue is being used. Must - * be less than 200 characters. E.g. - * `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - * @type string $origin - * Optional. An optional string representing the origin of this request. This - * field should include human-understandable information to distinguish - * origins from each other. Must be less than 200 characters. E.g. - * `migs-35678234` - * @type string $help_link - * Optional. A URL where an end user can learn more about removing this hold. - * E.g. - * `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time this TagHold was created. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagHolds::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name of a TagHold. This is a String of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` - * (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by - * the server. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The resource name of a TagHold. This is a String of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` - * (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by - * the server. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The name of the resource where the TagValue is being used. Must - * be less than 200 characters. E.g. - * `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - * - * Generated from protobuf field string holder = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getHolder() - { - return $this->holder; - } - - /** - * Required. The name of the resource where the TagValue is being used. Must - * be less than 200 characters. E.g. - * `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - * - * Generated from protobuf field string holder = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setHolder($var) - { - GPBUtil::checkString($var, True); - $this->holder = $var; - - return $this; - } - - /** - * Optional. An optional string representing the origin of this request. This - * field should include human-understandable information to distinguish - * origins from each other. Must be less than 200 characters. E.g. - * `migs-35678234` - * - * Generated from protobuf field string origin = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrigin() - { - return $this->origin; - } - - /** - * Optional. An optional string representing the origin of this request. This - * field should include human-understandable information to distinguish - * origins from each other. Must be less than 200 characters. E.g. - * `migs-35678234` - * - * Generated from protobuf field string origin = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrigin($var) - { - GPBUtil::checkString($var, True); - $this->origin = $var; - - return $this; - } - - /** - * Optional. A URL where an end user can learn more about removing this hold. - * E.g. - * `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` - * - * Generated from protobuf field string help_link = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getHelpLink() - { - return $this->help_link; - } - - /** - * Optional. A URL where an end user can learn more about removing this hold. - * E.g. - * `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` - * - * Generated from protobuf field string help_link = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setHelpLink($var) - { - GPBUtil::checkString($var, True); - $this->help_link = $var; - - return $this; - } - - /** - * Output only. The time this TagHold was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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 time this TagHold was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHoldsGrpcClient.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHoldsGrpcClient.php deleted file mode 100644 index 83919d8d33a9..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagHoldsGrpcClient.php +++ /dev/null @@ -1,85 +0,0 @@ -_simpleRequest('/google.cloud.resourcemanager.v3.TagHolds/CreateTagHold', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a TagHold. - * @param \Google\Cloud\ResourceManager\V3\DeleteTagHoldRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTagHold(\Google\Cloud\ResourceManager\V3\DeleteTagHoldRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagHolds/DeleteTagHold', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists TagHolds under a TagValue. - * @param \Google\Cloud\ResourceManager\V3\ListTagHoldsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTagHolds(\Google\Cloud\ResourceManager\V3\ListTagHoldsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagHolds/ListTagHolds', - $argument, - ['\Google\Cloud\ResourceManager\V3\ListTagHoldsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKey.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKey.php deleted file mode 100644 index a329b18ef1d3..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKey.php +++ /dev/null @@ -1,477 +0,0 @@ -google.cloud.resourcemanager.v3.TagKey - */ -class TagKey extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The resource name for a TagKey. Must be in the format - * `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for - * the TagKey. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Immutable. The resource name of the TagKey's parent. A TagKey can be - * parented by an Organization or a Project. For a TagKey parented by an - * Organization, its parent must be in the form `organizations/{org_id}`. For - * a TagKey parented by a Project, its parent can be in the form - * `projects/{project_id}` or `projects/{project_number}`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $parent = ''; - /** - * Required. Immutable. The user friendly name for a TagKey. The short name - * should be unique for TagKeys within the same tag namespace. - * The short name must be 1-63 characters, beginning and ending with - * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - * dots (.), and alphanumerics between. - * - * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - */ - protected $short_name = ''; - /** - * Output only. Immutable. Namespaced name of the TagKey. - * - * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - protected $namespaced_name = ''; - /** - * Optional. User-assigned description of the TagKey. Must not exceed 256 - * characters. - * Read-write. - * - * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $description = ''; - /** - * Output only. Creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Optional. Entity tag which users can pass to prevent race conditions. This - * field is always set in server responses. See UpdateTagKeyRequest for - * details. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - /** - * Optional. A purpose denotes that this Tag is intended for use in policies - * of a specific policy engine, and will involve that policy engine in - * management operations involving this Tag. A purpose does not grant a - * policy engine exclusive rights to the Tag, and it may be referenced by - * other policy engines. - * A purpose cannot be changed once set. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Purpose purpose = 11 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $purpose = 0; - /** - * Optional. Purpose data corresponds to the policy system that the tag is - * intended for. See documentation for `Purpose` for formatting of this field. - * Purpose data cannot be changed once set. - * - * Generated from protobuf field map purpose_data = 12 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $purpose_data; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The resource name for a TagKey. Must be in the format - * `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for - * the TagKey. - * @type string $parent - * Immutable. The resource name of the TagKey's parent. A TagKey can be - * parented by an Organization or a Project. For a TagKey parented by an - * Organization, its parent must be in the form `organizations/{org_id}`. For - * a TagKey parented by a Project, its parent can be in the form - * `projects/{project_id}` or `projects/{project_number}`. - * @type string $short_name - * Required. Immutable. The user friendly name for a TagKey. The short name - * should be unique for TagKeys within the same tag namespace. - * The short name must be 1-63 characters, beginning and ending with - * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - * dots (.), and alphanumerics between. - * @type string $namespaced_name - * Output only. Immutable. Namespaced name of the TagKey. - * @type string $description - * Optional. User-assigned description of the TagKey. Must not exceed 256 - * characters. - * Read-write. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Creation time. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time. - * @type string $etag - * Optional. Entity tag which users can pass to prevent race conditions. This - * field is always set in server responses. See UpdateTagKeyRequest for - * details. - * @type int $purpose - * Optional. A purpose denotes that this Tag is intended for use in policies - * of a specific policy engine, and will involve that policy engine in - * management operations involving this Tag. A purpose does not grant a - * policy engine exclusive rights to the Tag, and it may be referenced by - * other policy engines. - * A purpose cannot be changed once set. - * @type array|\Google\Protobuf\Internal\MapField $purpose_data - * Optional. Purpose data corresponds to the policy system that the tag is - * intended for. See documentation for `Purpose` for formatting of this field. - * Purpose data cannot be changed once set. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The resource name for a TagKey. Must be in the format - * `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for - * the TagKey. - * - * 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 a TagKey. Must be in the format - * `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for - * the TagKey. - * - * 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; - } - - /** - * Immutable. The resource name of the TagKey's parent. A TagKey can be - * parented by an Organization or a Project. For a TagKey parented by an - * Organization, its parent must be in the form `organizations/{org_id}`. For - * a TagKey parented by a Project, its parent can be in the form - * `projects/{project_id}` or `projects/{project_number}`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Immutable. The resource name of the TagKey's parent. A TagKey can be - * parented by an Organization or a Project. For a TagKey parented by an - * Organization, its parent must be in the form `organizations/{org_id}`. For - * a TagKey parented by a Project, its parent can be in the form - * `projects/{project_id}` or `projects/{project_number}`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. Immutable. The user friendly name for a TagKey. The short name - * should be unique for TagKeys within the same tag namespace. - * The short name must be 1-63 characters, beginning and ending with - * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - * dots (.), and alphanumerics between. - * - * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getShortName() - { - return $this->short_name; - } - - /** - * Required. Immutable. The user friendly name for a TagKey. The short name - * should be unique for TagKeys within the same tag namespace. - * The short name must be 1-63 characters, beginning and ending with - * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - * dots (.), and alphanumerics between. - * - * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setShortName($var) - { - GPBUtil::checkString($var, True); - $this->short_name = $var; - - return $this; - } - - /** - * Output only. Immutable. Namespaced name of the TagKey. - * - * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getNamespacedName() - { - return $this->namespaced_name; - } - - /** - * Output only. Immutable. Namespaced name of the TagKey. - * - * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setNamespacedName($var) - { - GPBUtil::checkString($var, True); - $this->namespaced_name = $var; - - return $this; - } - - /** - * Optional. User-assigned description of the TagKey. Must not exceed 256 - * characters. - * Read-write. - * - * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. User-assigned description of the TagKey. Must not exceed 256 - * characters. - * Read-write. - * - * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. Creation time. - * - * 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. Creation time. - * - * 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. Update time. - * - * 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. Update time. - * - * 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; - } - - /** - * Optional. Entity tag which users can pass to prevent race conditions. This - * field is always set in server responses. See UpdateTagKeyRequest for - * details. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. Entity tag which users can pass to prevent race conditions. This - * field is always set in server responses. See UpdateTagKeyRequest for - * details. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Optional. A purpose denotes that this Tag is intended for use in policies - * of a specific policy engine, and will involve that policy engine in - * management operations involving this Tag. A purpose does not grant a - * policy engine exclusive rights to the Tag, and it may be referenced by - * other policy engines. - * A purpose cannot be changed once set. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Purpose purpose = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPurpose() - { - return $this->purpose; - } - - /** - * Optional. A purpose denotes that this Tag is intended for use in policies - * of a specific policy engine, and will involve that policy engine in - * management operations involving this Tag. A purpose does not grant a - * policy engine exclusive rights to the Tag, and it may be referenced by - * other policy engines. - * A purpose cannot be changed once set. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Purpose purpose = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPurpose($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V3\Purpose::class); - $this->purpose = $var; - - return $this; - } - - /** - * Optional. Purpose data corresponds to the policy system that the tag is - * intended for. See documentation for `Purpose` for formatting of this field. - * Purpose data cannot be changed once set. - * - * Generated from protobuf field map purpose_data = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getPurposeData() - { - return $this->purpose_data; - } - - /** - * Optional. Purpose data corresponds to the policy system that the tag is - * intended for. See documentation for `Purpose` for formatting of this field. - * Purpose data cannot be changed once set. - * - * Generated from protobuf field map purpose_data = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setPurposeData($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->purpose_data = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKeysGrpcClient.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKeysGrpcClient.php deleted file mode 100644 index 1c849871b158..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagKeysGrpcClient.php +++ /dev/null @@ -1,190 +0,0 @@ -_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/ListTagKeys', - $argument, - ['\Google\Cloud\ResourceManager\V3\ListTagKeysResponse', 'decode'], - $metadata, $options); - } - - /** - * Retrieves a TagKey. This method will return `PERMISSION_DENIED` if the - * key does not exist or the user does not have permission to view it. - * @param \Google\Cloud\ResourceManager\V3\GetTagKeyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTagKey(\Google\Cloud\ResourceManager\V3\GetTagKeyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/GetTagKey', - $argument, - ['\Google\Cloud\ResourceManager\V3\TagKey', 'decode'], - $metadata, $options); - } - - /** - * Retrieves a TagKey by its namespaced name. - * This method will return `PERMISSION_DENIED` if the key does not exist - * or the user does not have permission to view it. - * @param \Google\Cloud\ResourceManager\V3\GetNamespacedTagKeyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetNamespacedTagKey(\Google\Cloud\ResourceManager\V3\GetNamespacedTagKeyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/GetNamespacedTagKey', - $argument, - ['\Google\Cloud\ResourceManager\V3\TagKey', 'decode'], - $metadata, $options); - } - - /** - * Creates a new TagKey. If another request with the same parameters is - * sent while the original request is in process, the second request - * will receive an error. A maximum of 1000 TagKeys can exist under a parent - * at any given time. - * @param \Google\Cloud\ResourceManager\V3\CreateTagKeyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTagKey(\Google\Cloud\ResourceManager\V3\CreateTagKeyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/CreateTagKey', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the attributes of the TagKey resource. - * @param \Google\Cloud\ResourceManager\V3\UpdateTagKeyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateTagKey(\Google\Cloud\ResourceManager\V3\UpdateTagKeyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/UpdateTagKey', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a TagKey. The TagKey cannot be deleted if it has any child - * TagValues. - * @param \Google\Cloud\ResourceManager\V3\DeleteTagKeyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTagKey(\Google\Cloud\ResourceManager\V3\DeleteTagKeyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/DeleteTagKey', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets the access control policy for a TagKey. The returned policy may be - * empty if no such policy or resource exists. The `resource` field should - * be the TagKey's resource name. For example, "tagKeys/1234". - * The caller must have - * `cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy` permission on - * the specified TagKey. - * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/GetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Sets the access control policy on a TagKey, replacing any existing - * policy. The `resource` field should be the TagKey's resource name. - * For example, "tagKeys/1234". - * The caller must have `resourcemanager.tagKeys.setIamPolicy` permission - * on the identified tagValue. - * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/SetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Returns permissions that a caller has on the specified TagKey. - * The `resource` field should be the TagKey's resource name. - * For example, "tagKeys/1234". - * - * There are no permissions required for making this API call. - * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagKeys/TestIamPermissions', - $argument, - ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValue.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValue.php deleted file mode 100644 index 6a2d8efaf8b1..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValue.php +++ /dev/null @@ -1,374 +0,0 @@ -google.cloud.resourcemanager.v3.TagValue - */ -class TagValue extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. Resource name for TagValue in the format `tagValues/456`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Immutable. The resource name of the new TagValue's parent TagKey. - * Must be of the form `tagKeys/{tag_key_id}`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $parent = ''; - /** - * Required. Immutable. User-assigned short name for TagValue. The short name - * should be unique for TagValues within the same parent TagKey. - * The short name must be 63 characters or less, beginning and ending with - * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - * dots (.), and alphanumerics between. - * - * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - */ - protected $short_name = ''; - /** - * Output only. The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * - * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $namespaced_name = ''; - /** - * Optional. User-assigned description of the TagValue. - * Must not exceed 256 characters. - * Read-write. - * - * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $description = ''; - /** - * Output only. Creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Optional. Entity tag which users can pass to prevent race conditions. This - * field is always set in server responses. See UpdateTagValueRequest for - * details. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. Resource name for TagValue in the format `tagValues/456`. - * @type string $parent - * Immutable. The resource name of the new TagValue's parent TagKey. - * Must be of the form `tagKeys/{tag_key_id}`. - * @type string $short_name - * Required. Immutable. User-assigned short name for TagValue. The short name - * should be unique for TagValues within the same parent TagKey. - * The short name must be 63 characters or less, beginning and ending with - * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - * dots (.), and alphanumerics between. - * @type string $namespaced_name - * Output only. The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * @type string $description - * Optional. User-assigned description of the TagValue. - * Must not exceed 256 characters. - * Read-write. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Creation time. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time. - * @type string $etag - * Optional. Entity tag which users can pass to prevent race conditions. This - * field is always set in server responses. See UpdateTagValueRequest for - * details. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. Resource name for TagValue in the format `tagValues/456`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. Resource name for TagValue in the format `tagValues/456`. - * - * 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; - } - - /** - * Immutable. The resource name of the new TagValue's parent TagKey. - * Must be of the form `tagKeys/{tag_key_id}`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Immutable. The resource name of the new TagValue's parent TagKey. - * Must be of the form `tagKeys/{tag_key_id}`. - * - * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. Immutable. User-assigned short name for TagValue. The short name - * should be unique for TagValues within the same parent TagKey. - * The short name must be 63 characters or less, beginning and ending with - * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - * dots (.), and alphanumerics between. - * - * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getShortName() - { - return $this->short_name; - } - - /** - * Required. Immutable. User-assigned short name for TagValue. The short name - * should be unique for TagValues within the same parent TagKey. - * The short name must be 63 characters or less, beginning and ending with - * an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - * dots (.), and alphanumerics between. - * - * Generated from protobuf field string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setShortName($var) - { - GPBUtil::checkString($var, True); - $this->short_name = $var; - - return $this; - } - - /** - * Output only. The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * - * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getNamespacedName() - { - return $this->namespaced_name; - } - - /** - * Output only. The namespaced name of the TagValue. Can be in the form - * `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - * `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - * - * Generated from protobuf field string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setNamespacedName($var) - { - GPBUtil::checkString($var, True); - $this->namespaced_name = $var; - - return $this; - } - - /** - * Optional. User-assigned description of the TagValue. - * Must not exceed 256 characters. - * Read-write. - * - * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. User-assigned description of the TagValue. - * Must not exceed 256 characters. - * Read-write. - * - * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. Creation time. - * - * 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. Creation time. - * - * 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. Update time. - * - * 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. Update time. - * - * 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; - } - - /** - * Optional. Entity tag which users can pass to prevent race conditions. This - * field is always set in server responses. See UpdateTagValueRequest for - * details. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. Entity tag which users can pass to prevent race conditions. This - * field is always set in server responses. See UpdateTagValueRequest for - * details. - * - * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValuesGrpcClient.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValuesGrpcClient.php deleted file mode 100644 index 69083414977d..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/TagValuesGrpcClient.php +++ /dev/null @@ -1,190 +0,0 @@ -_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/ListTagValues', - $argument, - ['\Google\Cloud\ResourceManager\V3\ListTagValuesResponse', 'decode'], - $metadata, $options); - } - - /** - * Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the - * value does not exist or the user does not have permission to view it. - * @param \Google\Cloud\ResourceManager\V3\GetTagValueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTagValue(\Google\Cloud\ResourceManager\V3\GetTagValueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/GetTagValue', - $argument, - ['\Google\Cloud\ResourceManager\V3\TagValue', 'decode'], - $metadata, $options); - } - - /** - * Retrieves a TagValue by its namespaced name. - * This method will return `PERMISSION_DENIED` if the value does not exist - * or the user does not have permission to view it. - * @param \Google\Cloud\ResourceManager\V3\GetNamespacedTagValueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetNamespacedTagValue(\Google\Cloud\ResourceManager\V3\GetNamespacedTagValueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/GetNamespacedTagValue', - $argument, - ['\Google\Cloud\ResourceManager\V3\TagValue', 'decode'], - $metadata, $options); - } - - /** - * Creates a TagValue as a child of the specified TagKey. If a another - * request with the same parameters is sent while the original request is in - * process the second request will receive an error. A maximum of 1000 - * TagValues can exist under a TagKey at any given time. - * @param \Google\Cloud\ResourceManager\V3\CreateTagValueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTagValue(\Google\Cloud\ResourceManager\V3\CreateTagValueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/CreateTagValue', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the attributes of the TagValue resource. - * @param \Google\Cloud\ResourceManager\V3\UpdateTagValueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateTagValue(\Google\Cloud\ResourceManager\V3\UpdateTagValueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/UpdateTagValue', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a TagValue. The TagValue cannot have any bindings when it is - * deleted. - * @param \Google\Cloud\ResourceManager\V3\DeleteTagValueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTagValue(\Google\Cloud\ResourceManager\V3\DeleteTagValueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/DeleteTagValue', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Gets the access control policy for a TagValue. The returned policy may be - * empty if no such policy or resource exists. The `resource` field should - * be the TagValue's resource name. For example: `tagValues/1234`. - * The caller must have the - * `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on - * the identified TagValue to get the access control policy. - * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/GetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Sets the access control policy on a TagValue, replacing any existing - * policy. The `resource` field should be the TagValue's resource name. - * For example: `tagValues/1234`. - * The caller must have `resourcemanager.tagValues.setIamPolicy` permission - * on the identified tagValue. - * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/SetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Returns permissions that a caller has on the specified TagValue. - * The `resource` field should be the TagValue's resource name. For example: - * `tagValues/1234`. - * - * There are no permissions required for making this API call. - * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/TestIamPermissions', - $argument, - ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderMetadata.php deleted file mode 100644 index 25c40d3462a8..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.UndeleteFolderMetadata - */ -class UndeleteFolderMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderRequest.php deleted file mode 100644 index b1addef0c746..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteFolderRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.resourcemanager.v3.UndeleteFolderRequest - */ -class UndeleteFolderRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the folder to undelete. - * Must be of the form `folders/{folder_id}`. - * - * 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 resource name of the folder to undelete. - * Must be of the form `folders/{folder_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the folder to undelete. - * Must be of the form `folders/{folder_id}`. - * - * 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 resource name of the folder to undelete. - * Must be of the form `folders/{folder_id}`. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteOrganizationMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteOrganizationMetadata.php deleted file mode 100644 index 4652f9473a93..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteOrganizationMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata - */ -class UndeleteOrganizationMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Organizations::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectMetadata.php deleted file mode 100644 index 2dcdba313d18..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.UndeleteProjectMetadata - */ -class UndeleteProjectMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectRequest.php deleted file mode 100644 index fbaf24001b78..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UndeleteProjectRequest.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.resourcemanager.v3.UndeleteProjectRequest - */ -class UndeleteProjectRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project (for example, `projects/415104041262`). - * Required. - * - * 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 project (for example, `projects/415104041262`). - * Required. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project (for example, `projects/415104041262`). - * Required. - * - * 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 project (for example, `projects/415104041262`). - * Required. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderMetadata.php deleted file mode 100644 index 4048d4d5bc33..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.UpdateFolderMetadata - */ -class UpdateFolderMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderRequest.php deleted file mode 100644 index ad7af259e5bc..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateFolderRequest.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.resourcemanager.v3.UpdateFolderRequest - */ -class UpdateFolderRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The new definition of the Folder. It must include the `name` - * field, which cannot be changed. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $folder = null; - /** - * Required. Fields to be updated. - * Only the `display_name` can be updated. - * - * 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\ResourceManager\V3\Folder $folder - * Required. The new definition of the Folder. It must include the `name` - * field, which cannot be changed. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. Fields to be updated. - * Only the `display_name` can be updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Folders::initOnce(); - parent::__construct($data); - } - - /** - * Required. The new definition of the Folder. It must include the `name` - * field, which cannot be changed. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\Folder|null - */ - public function getFolder() - { - return $this->folder; - } - - public function hasFolder() - { - return isset($this->folder); - } - - public function clearFolder() - { - unset($this->folder); - } - - /** - * Required. The new definition of the Folder. It must include the `name` - * field, which cannot be changed. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\Folder $var - * @return $this - */ - public function setFolder($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\Folder::class); - $this->folder = $var; - - return $this; - } - - /** - * Required. Fields to be updated. - * Only the `display_name` can be updated. - * - * 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. Fields to be updated. - * Only the `display_name` can be updated. - * - * 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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectMetadata.php deleted file mode 100644 index 9f46eb9a63c1..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.resourcemanager.v3.UpdateProjectMetadata - */ -class UpdateProjectMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectRequest.php deleted file mode 100644 index 46b58d100ac5..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateProjectRequest.php +++ /dev/null @@ -1,126 +0,0 @@ -google.cloud.resourcemanager.v3.UpdateProjectRequest - */ -class UpdateProjectRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The new definition of the project. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $project = null; - /** - * Optional. An update mask to selectively update fields. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceManager\V3\Project $project - * Required. The new definition of the project. - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. An update mask to selectively update fields. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\Projects::initOnce(); - parent::__construct($data); - } - - /** - * Required. The new definition of the project. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\Project|null - */ - public function getProject() - { - return $this->project; - } - - public function hasProject() - { - return isset($this->project); - } - - public function clearProject() - { - unset($this->project); - } - - /** - * Required. The new definition of the project. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\Project $var - * @return $this - */ - public function setProject($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\Project::class); - $this->project = $var; - - return $this; - } - - /** - * Optional. An update mask to selectively update fields. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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); - } - - /** - * Optional. An update mask to selectively update fields. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyMetadata.php deleted file mode 100644 index deef54c740c6..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.resourcemanager.v3.UpdateTagKeyMetadata - */ -class UpdateTagKeyMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyRequest.php deleted file mode 100644 index f6040aad1a0e..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagKeyRequest.php +++ /dev/null @@ -1,179 +0,0 @@ -google.cloud.resourcemanager.v3.UpdateTagKeyRequest - */ -class UpdateTagKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The new definition of the TagKey. Only the `description` and - * `etag` fields can be updated by this request. If the `etag` field is not - * empty, it must match the `etag` field of the existing tag key. Otherwise, - * `ABORTED` will be returned. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $tag_key = null; - /** - * Fields to be updated. The mask may only contain `description` or - * `etag`. If omitted entirely, both `description` and `etag` are assumed to - * be significant. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - /** - * Set as true to perform validations necessary for updating the resource, but - * not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceManager\V3\TagKey $tag_key - * Required. The new definition of the TagKey. Only the `description` and - * `etag` fields can be updated by this request. If the `etag` field is not - * empty, it must match the `etag` field of the existing tag key. Otherwise, - * `ABORTED` will be returned. - * @type \Google\Protobuf\FieldMask $update_mask - * Fields to be updated. The mask may only contain `description` or - * `etag`. If omitted entirely, both `description` and `etag` are assumed to - * be significant. - * @type bool $validate_only - * Set as true to perform validations necessary for updating the resource, but - * not actually perform the action. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce(); - parent::__construct($data); - } - - /** - * Required. The new definition of the TagKey. Only the `description` and - * `etag` fields can be updated by this request. If the `etag` field is not - * empty, it must match the `etag` field of the existing tag key. Otherwise, - * `ABORTED` will be returned. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\TagKey|null - */ - public function getTagKey() - { - return $this->tag_key; - } - - public function hasTagKey() - { - return isset($this->tag_key); - } - - public function clearTagKey() - { - unset($this->tag_key); - } - - /** - * Required. The new definition of the TagKey. Only the `description` and - * `etag` fields can be updated by this request. If the `etag` field is not - * empty, it must match the `etag` field of the existing tag key. Otherwise, - * `ABORTED` will be returned. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\TagKey $var - * @return $this - */ - public function setTagKey($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagKey::class); - $this->tag_key = $var; - - return $this; - } - - /** - * Fields to be updated. The mask may only contain `description` or - * `etag`. If omitted entirely, both `description` and `etag` are assumed to - * be significant. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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); - } - - /** - * Fields to be updated. The mask may only contain `description` or - * `etag`. If omitted entirely, both `description` and `etag` are assumed to - * be significant. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Set as true to perform validations necessary for updating the resource, but - * not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Set as true to perform validations necessary for updating the resource, but - * not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueMetadata.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueMetadata.php deleted file mode 100644 index 2503e836508e..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.resourcemanager.v3.UpdateTagValueMetadata - */ -class UpdateTagValueMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueRequest.php b/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueRequest.php deleted file mode 100644 index 6c560b1ef835..000000000000 --- a/owl-bot-staging/ResourceManager/v3/proto/src/Google/Cloud/ResourceManager/V3/UpdateTagValueRequest.php +++ /dev/null @@ -1,171 +0,0 @@ -google.cloud.resourcemanager.v3.UpdateTagValueRequest - */ -class UpdateTagValueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The new definition of the TagValue. Only fields `description` and - * `etag` fields can be updated by this request. If the `etag` field is - * nonempty, it must match the `etag` field of the existing ControlGroup. - * Otherwise, `ABORTED` will be returned. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $tag_value = null; - /** - * Optional. Fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - /** - * Optional. True to perform validations necessary for updating the resource, - * but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ResourceManager\V3\TagValue $tag_value - * Required. The new definition of the TagValue. Only fields `description` and - * `etag` fields can be updated by this request. If the `etag` field is - * nonempty, it must match the `etag` field of the existing ControlGroup. - * Otherwise, `ABORTED` will be returned. - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Fields to be updated. - * @type bool $validate_only - * Optional. True to perform validations necessary for updating the resource, - * but not actually perform the action. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagValues::initOnce(); - parent::__construct($data); - } - - /** - * Required. The new definition of the TagValue. Only fields `description` and - * `etag` fields can be updated by this request. If the `etag` field is - * nonempty, it must match the `etag` field of the existing ControlGroup. - * Otherwise, `ABORTED` will be returned. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\ResourceManager\V3\TagValue|null - */ - public function getTagValue() - { - return $this->tag_value; - } - - public function hasTagValue() - { - return isset($this->tag_value); - } - - public function clearTagValue() - { - unset($this->tag_value); - } - - /** - * Required. The new definition of the TagValue. Only fields `description` and - * `etag` fields can be updated by this request. If the `etag` field is - * nonempty, it must match the `etag` field of the existing ControlGroup. - * Otherwise, `ABORTED` will be returned. - * - * Generated from protobuf field .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\ResourceManager\V3\TagValue $var - * @return $this - */ - public function setTagValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagValue::class); - $this->tag_value = $var; - - return $this; - } - - /** - * Optional. Fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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); - } - - /** - * Optional. Fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Optional. True to perform validations necessary for updating the resource, - * but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Optional. True to perform validations necessary for updating the resource, - * but not actually perform the action. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/create_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/create_folder.php deleted file mode 100644 index 9a3e8f006090..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/create_folder.php +++ /dev/null @@ -1,109 +0,0 @@ -setParent($folderParent); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $foldersClient->createFolder($folder); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Folder $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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 -{ - $folderParent = '[PARENT]'; - - create_folder_sample($folderParent); -} -// [END cloudresourcemanager_v3_generated_Folders_CreateFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/delete_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/delete_folder.php deleted file mode 100644 index 1b39b9463289..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/delete_folder.php +++ /dev/null @@ -1,89 +0,0 @@ -deleteFolder($formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Folder $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = FoldersClient::folderName('[FOLDER]'); - - delete_folder_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_Folders_DeleteFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_folder.php deleted file mode 100644 index c991c2fc1439..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_folder.php +++ /dev/null @@ -1,71 +0,0 @@ -getFolder($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 = FoldersClient::folderName('[FOLDER]'); - - get_folder_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_Folders_GetFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_iam_policy.php deleted file mode 100644 index 72cd57a22f9f..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/get_iam_policy.php +++ /dev/null @@ -1,70 +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 cloudresourcemanager_v3_generated_Folders_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/list_folders.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/list_folders.php deleted file mode 100644 index 89bd5e38adfa..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/list_folders.php +++ /dev/null @@ -1,84 +0,0 @@ -listFolders($parent); - - /** @var Folder $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 -{ - $parent = '[PARENT]'; - - list_folders_sample($parent); -} -// [END cloudresourcemanager_v3_generated_Folders_ListFolders_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/move_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/move_folder.php deleted file mode 100644 index 44359a272874..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/move_folder.php +++ /dev/null @@ -1,99 +0,0 @@ -moveFolder($formattedName, $destinationParent); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Folder $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = FoldersClient::folderName('[FOLDER]'); - $destinationParent = '[DESTINATION_PARENT]'; - - move_folder_sample($formattedName, $destinationParent); -} -// [END cloudresourcemanager_v3_generated_Folders_MoveFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/search_folders.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/search_folders.php deleted file mode 100644 index 174625e2ec30..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/search_folders.php +++ /dev/null @@ -1,63 +0,0 @@ -searchFolders(); - - /** @var Folder $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 cloudresourcemanager_v3_generated_Folders_SearchFolders_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/set_iam_policy.php deleted file mode 100644 index 5ad2435cab46..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/set_iam_policy.php +++ /dev/null @@ -1,73 +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 cloudresourcemanager_v3_generated_Folders_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/test_iam_permissions.php deleted file mode 100644 index df182ebec87d..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/test_iam_permissions.php +++ /dev/null @@ -1,78 +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 cloudresourcemanager_v3_generated_Folders_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/undelete_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/undelete_folder.php deleted file mode 100644 index 66c2dce203e1..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/undelete_folder.php +++ /dev/null @@ -1,89 +0,0 @@ -undeleteFolder($formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Folder $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = FoldersClient::folderName('[FOLDER]'); - - undelete_folder_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_Folders_UndeleteFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/update_folder.php b/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/update_folder.php deleted file mode 100644 index 459a2a8d0055..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/FoldersClient/update_folder.php +++ /dev/null @@ -1,101 +0,0 @@ -setParent($folderParent); - $updateMask = new FieldMask(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $foldersClient->updateFolder($folder, $updateMask); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Folder $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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 -{ - $folderParent = '[PARENT]'; - - update_folder_sample($folderParent); -} -// [END cloudresourcemanager_v3_generated_Folders_UpdateFolder_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_iam_policy.php deleted file mode 100644 index fc7dcaa738d9..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_iam_policy.php +++ /dev/null @@ -1,71 +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 cloudresourcemanager_v3_generated_Organizations_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_organization.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_organization.php deleted file mode 100644 index 0de781575fb9..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/get_organization.php +++ /dev/null @@ -1,68 +0,0 @@ -getOrganization($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 = OrganizationsClient::organizationName('[ORGANIZATION]'); - - get_organization_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_Organizations_GetOrganization_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/search_organizations.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/search_organizations.php deleted file mode 100644 index c496c70f2514..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/search_organizations.php +++ /dev/null @@ -1,64 +0,0 @@ -searchOrganizations(); - - /** @var Organization $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 cloudresourcemanager_v3_generated_Organizations_SearchOrganizations_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/set_iam_policy.php deleted file mode 100644 index 57ebc77a4f74..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/set_iam_policy.php +++ /dev/null @@ -1,74 +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 cloudresourcemanager_v3_generated_Organizations_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/test_iam_permissions.php deleted file mode 100644 index 081ec42e2891..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/OrganizationsClient/test_iam_permissions.php +++ /dev/null @@ -1,78 +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 cloudresourcemanager_v3_generated_Organizations_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/create_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/create_project.php deleted file mode 100644 index e1c0c9bda86a..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/create_project.php +++ /dev/null @@ -1,72 +0,0 @@ -createProject($project); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Project $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudresourcemanager_v3_generated_Projects_CreateProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/delete_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/delete_project.php deleted file mode 100644 index e199eeeac375..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/delete_project.php +++ /dev/null @@ -1,110 +0,0 @@ -deleteProject($formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Project $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = ProjectsClient::projectName('[PROJECT]'); - - delete_project_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_Projects_DeleteProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_iam_policy.php deleted file mode 100644 index 19010ec4aaef..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_iam_policy.php +++ /dev/null @@ -1,68 +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 cloudresourcemanager_v3_generated_Projects_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_project.php deleted file mode 100644 index a2e5ad9bf7b7..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/get_project.php +++ /dev/null @@ -1,70 +0,0 @@ -getProject($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 = ProjectsClient::projectName('[PROJECT]'); - - get_project_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_Projects_GetProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/list_projects.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/list_projects.php deleted file mode 100644 index 14c8db847011..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/list_projects.php +++ /dev/null @@ -1,80 +0,0 @@ -listProjects($parent); - - /** @var Project $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 -{ - $parent = '[PARENT]'; - - list_projects_sample($parent); -} -// [END cloudresourcemanager_v3_generated_Projects_ListProjects_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/move_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/move_project.php deleted file mode 100644 index 7b5a75dbbb91..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/move_project.php +++ /dev/null @@ -1,95 +0,0 @@ -moveProject($formattedName, $destinationParent); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Project $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = ProjectsClient::projectName('[PROJECT]'); - $destinationParent = '[DESTINATION_PARENT]'; - - move_project_sample($formattedName, $destinationParent); -} -// [END cloudresourcemanager_v3_generated_Projects_MoveProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/search_projects.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/search_projects.php deleted file mode 100644 index 2a0fb32a7f5e..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/search_projects.php +++ /dev/null @@ -1,67 +0,0 @@ -searchProjects(); - - /** @var Project $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 cloudresourcemanager_v3_generated_Projects_SearchProjects_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/set_iam_policy.php deleted file mode 100644 index 6560d06dc5ac..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/set_iam_policy.php +++ /dev/null @@ -1,109 +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 cloudresourcemanager_v3_generated_Projects_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/test_iam_permissions.php deleted file mode 100644 index 5d68ce447dc2..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/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 cloudresourcemanager_v3_generated_Projects_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/undelete_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/undelete_project.php deleted file mode 100644 index ad1cbfecc2e5..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/undelete_project.php +++ /dev/null @@ -1,88 +0,0 @@ -undeleteProject($formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Project $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = ProjectsClient::projectName('[PROJECT]'); - - undelete_project_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_Projects_UndeleteProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/update_project.php b/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/update_project.php deleted file mode 100644 index d6e1884ddb8b..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/ProjectsClient/update_project.php +++ /dev/null @@ -1,73 +0,0 @@ -updateProject($project); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Project $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudresourcemanager_v3_generated_Projects_UpdateProject_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/create_tag_binding.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/create_tag_binding.php deleted file mode 100644 index 2e06d03f8f5e..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/create_tag_binding.php +++ /dev/null @@ -1,68 +0,0 @@ -createTagBinding($tagBinding); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TagBinding $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudresourcemanager_v3_generated_TagBindings_CreateTagBinding_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/delete_tag_binding.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/delete_tag_binding.php deleted file mode 100644 index c469017971fa..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/delete_tag_binding.php +++ /dev/null @@ -1,77 +0,0 @@ -deleteTagBinding($formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = TagBindingsClient::tagBindingName('[TAG_BINDING]'); - - delete_tag_binding_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_TagBindings_DeleteTagBinding_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_effective_tags.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_effective_tags.php deleted file mode 100644 index 19126e25c07b..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_effective_tags.php +++ /dev/null @@ -1,73 +0,0 @@ -listEffectiveTags($parent); - - /** @var EffectiveTag $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 -{ - $parent = '[PARENT]'; - - list_effective_tags_sample($parent); -} -// [END cloudresourcemanager_v3_generated_TagBindings_ListEffectiveTags_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_tag_bindings.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_tag_bindings.php deleted file mode 100644 index a55f86dde818..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagBindingsClient/list_tag_bindings.php +++ /dev/null @@ -1,76 +0,0 @@ -listTagBindings($parent); - - /** @var TagBinding $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 -{ - $parent = '[PARENT]'; - - list_tag_bindings_sample($parent); -} -// [END cloudresourcemanager_v3_generated_TagBindings_ListTagBindings_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/create_tag_hold.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/create_tag_hold.php deleted file mode 100644 index f895cf3a9be7..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/create_tag_hold.php +++ /dev/null @@ -1,88 +0,0 @@ -setHolder($tagHoldHolder); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $tagHoldsClient->createTagHold($formattedParent, $tagHold); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TagHold $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = TagHoldsClient::tagValueName('[TAG_VALUE]'); - $tagHoldHolder = '[HOLDER]'; - - create_tag_hold_sample($formattedParent, $tagHoldHolder); -} -// [END cloudresourcemanager_v3_generated_TagHolds_CreateTagHold_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/delete_tag_hold.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/delete_tag_hold.php deleted file mode 100644 index 24f7a23098a9..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/delete_tag_hold.php +++ /dev/null @@ -1,76 +0,0 @@ -deleteTagHold($formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = TagHoldsClient::tagHoldName('[TAG_VALUE]', '[TAG_HOLD]'); - - delete_tag_hold_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_TagHolds_DeleteTagHold_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/list_tag_holds.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/list_tag_holds.php deleted file mode 100644 index fd28f5d5a69e..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagHoldsClient/list_tag_holds.php +++ /dev/null @@ -1,72 +0,0 @@ -listTagHolds($formattedParent); - - /** @var TagHold $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 = TagHoldsClient::tagValueName('[TAG_VALUE]'); - - list_tag_holds_sample($formattedParent); -} -// [END cloudresourcemanager_v3_generated_TagHolds_ListTagHolds_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/create_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/create_tag_key.php deleted file mode 100644 index 83db769e3925..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/create_tag_key.php +++ /dev/null @@ -1,89 +0,0 @@ -setShortName($tagKeyShortName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $tagKeysClient->createTagKey($tagKey); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TagKey $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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 -{ - $tagKeyShortName = '[SHORT_NAME]'; - - create_tag_key_sample($tagKeyShortName); -} -// [END cloudresourcemanager_v3_generated_TagKeys_CreateTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/delete_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/delete_tag_key.php deleted file mode 100644 index 8d6c969a27bf..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/delete_tag_key.php +++ /dev/null @@ -1,81 +0,0 @@ -deleteTagKey($formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TagKey $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = TagKeysClient::tagKeyName('[TAG_KEY]'); - - delete_tag_key_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_TagKeys_DeleteTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_iam_policy.php deleted file mode 100644 index 1ae478316841..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_iam_policy.php +++ /dev/null @@ -1,71 +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 cloudresourcemanager_v3_generated_TagKeys_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_namespaced_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_namespaced_tag_key.php deleted file mode 100644 index 7a0fe86e4f2d..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_namespaced_tag_key.php +++ /dev/null @@ -1,71 +0,0 @@ -getNamespacedTagKey($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 = TagKeysClient::tagKeyName('[TAG_KEY]'); - - get_namespaced_tag_key_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_TagKeys_GetNamespacedTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_tag_key.php deleted file mode 100644 index 9872587b80e4..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/get_tag_key.php +++ /dev/null @@ -1,68 +0,0 @@ -getTagKey($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 = TagKeysClient::tagKeyName('[TAG_KEY]'); - - get_tag_key_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_TagKeys_GetTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/list_tag_keys.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/list_tag_keys.php deleted file mode 100644 index 58bc5e54713d..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/list_tag_keys.php +++ /dev/null @@ -1,72 +0,0 @@ -listTagKeys($parent); - - /** @var TagKey $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 -{ - $parent = '[PARENT]'; - - list_tag_keys_sample($parent); -} -// [END cloudresourcemanager_v3_generated_TagKeys_ListTagKeys_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/set_iam_policy.php deleted file mode 100644 index fb3fe9de4d09..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/set_iam_policy.php +++ /dev/null @@ -1,73 +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 cloudresourcemanager_v3_generated_TagKeys_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/test_iam_permissions.php deleted file mode 100644 index 0cb526bf3989..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/test_iam_permissions.php +++ /dev/null @@ -1,78 +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 cloudresourcemanager_v3_generated_TagKeys_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/update_tag_key.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/update_tag_key.php deleted file mode 100644 index b14aaaf62e77..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagKeysClient/update_tag_key.php +++ /dev/null @@ -1,86 +0,0 @@ -setShortName($tagKeyShortName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $tagKeysClient->updateTagKey($tagKey); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TagKey $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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 -{ - $tagKeyShortName = '[SHORT_NAME]'; - - update_tag_key_sample($tagKeyShortName); -} -// [END cloudresourcemanager_v3_generated_TagKeys_UpdateTagKey_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/create_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/create_tag_value.php deleted file mode 100644 index 065cdf9fcc05..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/create_tag_value.php +++ /dev/null @@ -1,89 +0,0 @@ -setShortName($tagValueShortName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $tagValuesClient->createTagValue($tagValue); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TagValue $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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 -{ - $tagValueShortName = '[SHORT_NAME]'; - - create_tag_value_sample($tagValueShortName); -} -// [END cloudresourcemanager_v3_generated_TagValues_CreateTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/delete_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/delete_tag_value.php deleted file mode 100644 index 93ff983e0d90..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/delete_tag_value.php +++ /dev/null @@ -1,80 +0,0 @@ -deleteTagValue($formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TagValue $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = TagValuesClient::tagValueName('[TAG_VALUE]'); - - delete_tag_value_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_TagValues_DeleteTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_iam_policy.php deleted file mode 100644 index 95a33594f7b7..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_iam_policy.php +++ /dev/null @@ -1,71 +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 cloudresourcemanager_v3_generated_TagValues_GetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_namespaced_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_namespaced_tag_value.php deleted file mode 100644 index 9703e6d491af..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_namespaced_tag_value.php +++ /dev/null @@ -1,76 +0,0 @@ -getNamespacedTagValue($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 = TagValuesClient::tagValueName('[TAG_VALUE]'); - - get_namespaced_tag_value_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_TagValues_GetNamespacedTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_tag_value.php deleted file mode 100644 index b721ee8773d6..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/get_tag_value.php +++ /dev/null @@ -1,68 +0,0 @@ -getTagValue($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 = TagValuesClient::tagValueName('[TAG_VALUE]'); - - get_tag_value_sample($formattedName); -} -// [END cloudresourcemanager_v3_generated_TagValues_GetTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/list_tag_values.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/list_tag_values.php deleted file mode 100644 index 960d00ca43a1..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/list_tag_values.php +++ /dev/null @@ -1,70 +0,0 @@ -listTagValues($parent); - - /** @var TagValue $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 -{ - $parent = '[PARENT]'; - - list_tag_values_sample($parent); -} -// [END cloudresourcemanager_v3_generated_TagValues_ListTagValues_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/set_iam_policy.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/set_iam_policy.php deleted file mode 100644 index 556833ecbfe4..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/set_iam_policy.php +++ /dev/null @@ -1,73 +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 cloudresourcemanager_v3_generated_TagValues_SetIamPolicy_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/test_iam_permissions.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/test_iam_permissions.php deleted file mode 100644 index e9ef1aab1731..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/test_iam_permissions.php +++ /dev/null @@ -1,78 +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 cloudresourcemanager_v3_generated_TagValues_TestIamPermissions_sync] diff --git a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/update_tag_value.php b/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/update_tag_value.php deleted file mode 100644 index b5ed4916c82d..000000000000 --- a/owl-bot-staging/ResourceManager/v3/samples/V3/TagValuesClient/update_tag_value.php +++ /dev/null @@ -1,86 +0,0 @@ -setShortName($tagValueShortName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $tagValuesClient->updateTagValue($tagValue); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TagValue $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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 -{ - $tagValueShortName = '[SHORT_NAME]'; - - update_tag_value_sample($tagValueShortName); -} -// [END cloudresourcemanager_v3_generated_TagValues_UpdateTagValue_sync] diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/FoldersClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/FoldersClient.php deleted file mode 100644 index 4bd8a842cfed..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/FoldersClient.php +++ /dev/null @@ -1,34 +0,0 @@ -createFolder($folder); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $foldersClient->createFolder($folder); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $foldersClient->resumeOperation($operationName, 'createFolder'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $foldersClient->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. - */ -class FoldersGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.resourcemanager.v3.Folders'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'cloudresourcemanager.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', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private static $folderNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/folders_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/folders_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/folders_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/folders_rest_client_config.php', - ], - ], - ]; - } - - private static function getFolderNameTemplate() - { - if (self::$folderNameTemplate == null) { - self::$folderNameTemplate = new PathTemplate('folders/{folder}'); - } - - return self::$folderNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'folder' => self::getFolderNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a folder - * resource. - * - * @param string $folder - * - * @return string The formatted folder resource. - */ - public static function folderName($folder) - { - return self::getFolderNameTemplate()->render([ - 'folder' => $folder, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - folder: folders/{folder} - * - * 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"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 'cloudresourcemanager.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); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a folder in the resource hierarchy. - * Returns an `Operation` which can be used to track the progress of the - * folder creation workflow. - * Upon success, the `Operation.response` field will be populated with the - * created Folder. - * - * In order to succeed, the addition of this new folder must not violate - * the folder naming, height, or fanout constraints. - * - * + The folder's `display_name` must be distinct from all other folders that - * share its parent. - * + The addition of the folder must not cause the active folder hierarchy - * to exceed a height of 10. Note, the full active + deleted folder hierarchy - * is allowed to reach a height of 20; this provides additional headroom when - * moving folders that contain deleted folders. - * + The addition of the folder must not cause the total number of folders - * under its parent to exceed 300. - * - * If the operation fails due to a folder constraint violation, some errors - * may be returned by the `CreateFolder` request, with status code - * `FAILED_PRECONDITION` and an error description. Other folder constraint - * violations will be communicated in the `Operation`, with the specific - * `PreconditionFailure` returned in the details list in the `Operation.error` - * field. - * - * The caller must have `resourcemanager.folders.create` permission on the - * identified parent. - * - * Sample code: - * ``` - * $foldersClient = new FoldersClient(); - * try { - * $folder = new Folder(); - * $operationResponse = $foldersClient->createFolder($folder); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $foldersClient->createFolder($folder); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $foldersClient->resumeOperation($operationName, 'createFolder'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $foldersClient->close(); - * } - * ``` - * - * @param Folder $folder Required. The folder being created, only the display name and parent will - * be consulted. All other fields will be ignored. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createFolder($folder, array $optionalArgs = []) - { - $request = new CreateFolderRequest(); - $request->setFolder($folder); - return $this->startOperationsCall('CreateFolder', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Requests deletion of a folder. The folder is moved into the - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] - * state immediately, and is deleted approximately 30 days later. This method - * may only be called on an empty folder, where a folder is empty if it - * doesn't contain any folders or projects in the - * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If - * called on a folder in - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] - * state the operation will result in a no-op success. - * The caller must have `resourcemanager.folders.delete` permission on the - * identified folder. - * - * Sample code: - * ``` - * $foldersClient = new FoldersClient(); - * try { - * $formattedName = $foldersClient->folderName('[FOLDER]'); - * $operationResponse = $foldersClient->deleteFolder($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $foldersClient->deleteFolder($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $foldersClient->resumeOperation($operationName, 'deleteFolder'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $foldersClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the folder to be deleted. - * Must be of the form `folders/{folder_id}`. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteFolder($name, array $optionalArgs = []) - { - $request = new DeleteFolderRequest(); - $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->startOperationsCall('DeleteFolder', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Retrieves a folder identified by the supplied resource name. - * Valid folder resource names have the format `folders/{folder_id}` - * (for example, `folders/1234`). - * The caller must have `resourcemanager.folders.get` permission on the - * identified folder. - * - * Sample code: - * ``` - * $foldersClient = new FoldersClient(); - * try { - * $formattedName = $foldersClient->folderName('[FOLDER]'); - * $response = $foldersClient->getFolder($formattedName); - * } finally { - * $foldersClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the folder to retrieve. - * Must be of the form `folders/{folder_id}`. - * @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\ResourceManager\V3\Folder - * - * @throws ApiException if the remote call fails - */ - public function getFolder($name, array $optionalArgs = []) - { - $request = new GetFolderRequest(); - $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('GetFolder', Folder::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the access control policy for a folder. The returned policy may be - * empty if no such policy or resource exists. The `resource` field should - * be the folder's resource name, for example: "folders/1234". - * The caller must have `resourcemanager.folders.getIamPolicy` permission - * on the identified folder. - * - * Sample code: - * ``` - * $foldersClient = new FoldersClient(); - * try { - * $resource = 'resource'; - * $response = $foldersClient->getIamPolicy($resource); - * } finally { - * $foldersClient->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(); - } - - /** - * Lists the folders that are direct descendants of supplied parent resource. - * `list()` provides a strongly consistent view of the folders underneath - * the specified parent resource. - * `list()` returns folders sorted based upon the (ascending) lexical ordering - * of their display_name. - * The caller must have `resourcemanager.folders.list` permission on the - * identified parent. - * - * Sample code: - * ``` - * $foldersClient = new FoldersClient(); - * try { - * $parent = 'parent'; - * // Iterate over pages of elements - * $pagedResponse = $foldersClient->listFolders($parent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $foldersClient->listFolders($parent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $foldersClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource whose folders are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * - * Access to this method is controlled by checking the - * `resourcemanager.folders.list` permission on the `parent`. - * @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 bool $showDeleted - * Optional. Controls whether folders in the - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] - * state should be returned. Defaults to false. - * @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 listFolders($parent, array $optionalArgs = []) - { - $request = new ListFoldersRequest(); - $request->setParent($parent); - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['showDeleted'])) { - $request->setShowDeleted($optionalArgs['showDeleted']); - } - - return $this->getPagedListResponse('ListFolders', $optionalArgs, ListFoldersResponse::class, $request); - } - - /** - * Moves a folder under a new resource parent. - * Returns an `Operation` which can be used to track the progress of the - * folder move workflow. - * Upon success, the `Operation.response` field will be populated with the - * moved folder. - * Upon failure, a `FolderOperationError` categorizing the failure cause will - * be returned - if the failure occurs synchronously then the - * `FolderOperationError` will be returned in the `Status.details` field. - * If it occurs asynchronously, then the FolderOperation will be returned - * in the `Operation.error` field. - * In addition, the `Operation.metadata` field will be populated with a - * `FolderOperation` message as an aid to stateless clients. - * Folder moves will be rejected if they violate either the naming, height, - * or fanout constraints described in the - * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] - * documentation. The caller must have `resourcemanager.folders.move` - * permission on the folder's current and proposed new parent. - * - * Sample code: - * ``` - * $foldersClient = new FoldersClient(); - * try { - * $formattedName = $foldersClient->folderName('[FOLDER]'); - * $destinationParent = 'destination_parent'; - * $operationResponse = $foldersClient->moveFolder($formattedName, $destinationParent); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $foldersClient->moveFolder($formattedName, $destinationParent); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $foldersClient->resumeOperation($operationName, 'moveFolder'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $foldersClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Folder to move. - * Must be of the form folders/{folder_id} - * @param string $destinationParent Required. The resource name of the folder or organization which should be - * the folder's new parent. Must be of the form `folders/{folder_id}` or - * `organizations/{org_id}`. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function moveFolder($name, $destinationParent, array $optionalArgs = []) - { - $request = new MoveFolderRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setDestinationParent($destinationParent); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('MoveFolder', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Search for folders that match specific filter criteria. - * `search()` provides an eventually consistent view of the folders a user has - * access to which meet the specified filter criteria. - * - * This will only return folders on which the caller has the - * permission `resourcemanager.folders.get`. - * - * Sample code: - * ``` - * $foldersClient = new FoldersClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $foldersClient->searchFolders(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $foldersClient->searchFolders(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $foldersClient->close(); - * } - * ``` - * - * @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 $query - * Optional. Search criteria used to select the folders to return. - * If no search criteria is specified then all accessible folders will be - * returned. - * - * Query expressions can be used to restrict results based upon displayName, - * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` - * can be used along with the suffix wildcard symbol `*`. - * - * The `displayName` field in a query expression should use escaped quotes - * for values that include whitespace to prevent unexpected behavior. - * - * ``` - * | Field | Description | - * |-------------------------|----------------------------------------| - * | displayName | Filters by displayName. | - * | parent | Filters by parent (for example: folders/123). | - * | state, lifecycleState | Filters by state. | - * ``` - * - * Some example queries are: - * - * * Query `displayName=Test*` returns Folder resources whose display name - * starts with "Test". - * * Query `state=ACTIVE` returns Folder resources with - * `state` set to `ACTIVE`. - * * Query `parent=folders/123` returns Folder resources that have - * `folders/123` as a parent resource. - * * Query `parent=folders/123 AND state=ACTIVE` returns active - * Folder resources that have `folders/123` as a parent resource. - * * Query `displayName=\\"Test String\\"` returns Folder resources with - * display names that include both "Test" and "String". - * @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 searchFolders(array $optionalArgs = []) - { - $request = new SearchFoldersRequest(); - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['query'])) { - $request->setQuery($optionalArgs['query']); - } - - return $this->getPagedListResponse('SearchFolders', $optionalArgs, SearchFoldersResponse::class, $request); - } - - /** - * Sets the access control policy on a folder, replacing any existing policy. - * The `resource` field should be the folder's resource name, for example: - * "folders/1234". - * The caller must have `resourcemanager.folders.setIamPolicy` permission - * on the identified folder. - * - * Sample code: - * ``` - * $foldersClient = new FoldersClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $foldersClient->setIamPolicy($resource, $policy); - * } finally { - * $foldersClient->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(); - } - - /** - * Returns permissions that a caller has on the specified folder. - * The `resource` field should be the folder's resource name, - * for example: "folders/1234". - * - * There are no permissions required for making this API call. - * - * Sample code: - * ``` - * $foldersClient = new FoldersClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $foldersClient->testIamPermissions($resource, $permissions); - * } finally { - * $foldersClient->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(); - } - - /** - * Cancels the deletion request for a folder. This method may be called on a - * folder in any state. If the folder is in the - * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the - * result will be a no-op success. In order to succeed, the folder's parent - * must be in the - * [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In - * addition, reintroducing the folder into the tree must not violate folder - * naming, height, and fanout constraints described in the - * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] - * documentation. The caller must have `resourcemanager.folders.undelete` - * permission on the identified folder. - * - * Sample code: - * ``` - * $foldersClient = new FoldersClient(); - * try { - * $formattedName = $foldersClient->folderName('[FOLDER]'); - * $operationResponse = $foldersClient->undeleteFolder($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $foldersClient->undeleteFolder($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $foldersClient->resumeOperation($operationName, 'undeleteFolder'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $foldersClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the folder to undelete. - * Must be of the form `folders/{folder_id}`. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function undeleteFolder($name, array $optionalArgs = []) - { - $request = new UndeleteFolderRequest(); - $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->startOperationsCall('UndeleteFolder', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates a folder, changing its `display_name`. - * Changes to the folder `display_name` will be rejected if they violate - * either the `display_name` formatting rules or the naming constraints - * described in the - * [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] - * documentation. - * - * The folder's `display_name` must start and end with a letter or digit, - * may contain letters, digits, spaces, hyphens and underscores and can be - * between 3 and 30 characters. This is captured by the regular expression: - * `[\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]`. - * The caller must have `resourcemanager.folders.update` permission on the - * identified folder. - * - * If the update fails due to the unique name constraint then a - * `PreconditionFailure` explaining this violation will be returned - * in the Status.details field. - * - * Sample code: - * ``` - * $foldersClient = new FoldersClient(); - * try { - * $folder = new Folder(); - * $updateMask = new FieldMask(); - * $operationResponse = $foldersClient->updateFolder($folder, $updateMask); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $foldersClient->updateFolder($folder, $updateMask); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $foldersClient->resumeOperation($operationName, 'updateFolder'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $foldersClient->close(); - * } - * ``` - * - * @param Folder $folder Required. The new definition of the Folder. It must include the `name` - * field, which cannot be changed. - * @param FieldMask $updateMask Required. Fields to be updated. - * Only the `display_name` can be updated. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateFolder($folder, $updateMask, array $optionalArgs = []) - { - $request = new UpdateFolderRequest(); - $requestParamHeaders = []; - $request->setFolder($folder); - $request->setUpdateMask($updateMask); - $requestParamHeaders['folder.name'] = $folder->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateFolder', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/OrganizationsGapicClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/OrganizationsGapicClient.php deleted file mode 100644 index c33665ddb15c..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/OrganizationsGapicClient.php +++ /dev/null @@ -1,544 +0,0 @@ -getIamPolicy($resource); - * } finally { - * $organizationsClient->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. - */ -class OrganizationsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.resourcemanager.v3.Organizations'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'cloudresourcemanager.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', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private static $organizationNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/organizations_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/organizations_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/organizations_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/organizations_rest_client_config.php', - ], - ], - ]; - } - - private static function getOrganizationNameTemplate() - { - if (self::$organizationNameTemplate == null) { - self::$organizationNameTemplate = new PathTemplate('organizations/{organization}'); - } - - return self::$organizationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'organization' => self::getOrganizationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a organization - * resource. - * - * @param string $organization - * - * @return string The formatted organization resource. - */ - public static function organizationName($organization) - { - return self::getOrganizationNameTemplate()->render([ - 'organization' => $organization, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - organization: organizations/{organization} - * - * 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 'cloudresourcemanager.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); - } - - /** - * Gets the access control policy for an organization resource. The policy may - * be empty if no such policy or resource exists. The `resource` field should - * be the organization's resource name, for example: "organizations/123". - * - * Authorization requires the IAM permission - * `resourcemanager.organizations.getIamPolicy` on the specified organization. - * - * Sample code: - * ``` - * $organizationsClient = new OrganizationsClient(); - * try { - * $resource = 'resource'; - * $response = $organizationsClient->getIamPolicy($resource); - * } finally { - * $organizationsClient->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(); - } - - /** - * Fetches an organization resource identified by the specified resource name. - * - * Sample code: - * ``` - * $organizationsClient = new OrganizationsClient(); - * try { - * $formattedName = $organizationsClient->organizationName('[ORGANIZATION]'); - * $response = $organizationsClient->getOrganization($formattedName); - * } finally { - * $organizationsClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Organization to fetch. This is the - * organization's relative path in the API, formatted as - * "organizations/[organizationId]". For example, "organizations/1234". - * @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\ResourceManager\V3\Organization - * - * @throws ApiException if the remote call fails - */ - public function getOrganization($name, array $optionalArgs = []) - { - $request = new GetOrganizationRequest(); - $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('GetOrganization', Organization::class, $optionalArgs, $request)->wait(); - } - - /** - * Searches organization resources that are visible to the user and satisfy - * the specified filter. This method returns organizations in an unspecified - * order. New organizations do not necessarily appear at the end of the - * results, and may take a small amount of time to appear. - * - * Search will only return organizations on which the user has the permission - * `resourcemanager.organizations.get` - * - * Sample code: - * ``` - * $organizationsClient = new OrganizationsClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $organizationsClient->searchOrganizations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $organizationsClient->searchOrganizations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $organizationsClient->close(); - * } - * ``` - * - * @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 $query - * Optional. An optional query string used to filter the Organizations to - * return in the response. Query rules are case-insensitive. - * - * - * ``` - * | Field | Description | - * |------------------|--------------------------------------------| - * | directoryCustomerId, owner.directoryCustomerId | Filters by directory - * customer id. | - * | domain | Filters by domain. | - * ``` - * - * Organizations may be queried by `directoryCustomerId` or by - * `domain`, where the domain is a G Suite domain, for example: - * - * * Query `directorycustomerid:123456789` returns Organization - * resources with `owner.directory_customer_id` equal to `123456789`. - * * Query `domain:google.com` returns Organization resources corresponding - * to the domain `google.com`. - * @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 searchOrganizations(array $optionalArgs = []) - { - $request = new SearchOrganizationsRequest(); - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['query'])) { - $request->setQuery($optionalArgs['query']); - } - - return $this->getPagedListResponse('SearchOrganizations', $optionalArgs, SearchOrganizationsResponse::class, $request); - } - - /** - * Sets the access control policy on an organization resource. Replaces any - * existing policy. The `resource` field should be the organization's resource - * name, for example: "organizations/123". - * - * Authorization requires the IAM permission - * `resourcemanager.organizations.setIamPolicy` on the specified organization. - * - * Sample code: - * ``` - * $organizationsClient = new OrganizationsClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $organizationsClient->setIamPolicy($resource, $policy); - * } finally { - * $organizationsClient->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(); - } - - /** - * Returns the permissions that a caller has on the specified organization. - * The `resource` field should be the organization's resource name, - * for example: "organizations/123". - * - * There are no permissions required for making this API call. - * - * Sample code: - * ``` - * $organizationsClient = new OrganizationsClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $organizationsClient->testIamPermissions($resource, $permissions); - * } finally { - * $organizationsClient->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(); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/ProjectsGapicClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/ProjectsGapicClient.php deleted file mode 100644 index ba19e02170e3..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/ProjectsGapicClient.php +++ /dev/null @@ -1,1139 +0,0 @@ -createProject($project); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $projectsClient->createProject($project); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'createProject'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $projectsClient->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. - */ -class ProjectsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.resourcemanager.v3.Projects'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'cloudresourcemanager.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', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private static $projectNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/projects_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/projects_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/projects_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/projects_rest_client_config.php', - ], - ], - ]; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'project' => self::getProjectNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName($project) - { - return self::getProjectNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - project: projects/{project} - * - * 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"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 'cloudresourcemanager.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); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Request that a new project be created. The result is an `Operation` which - * can be used to track the creation process. This process usually takes a few - * seconds, but can sometimes take much longer. The tracking `Operation` is - * automatically deleted after a few hours, so there is no need to call - * `DeleteOperation`. - * - * Sample code: - * ``` - * $projectsClient = new ProjectsClient(); - * try { - * $project = new Project(); - * $operationResponse = $projectsClient->createProject($project); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $projectsClient->createProject($project); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'createProject'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $projectsClient->close(); - * } - * ``` - * - * @param Project $project Required. The Project to create. - * - * Project ID is required. If the requested ID is unavailable, the request - * fails. - * - * If the `parent` field is set, the `resourcemanager.projects.create` - * permission is checked on the parent resource. If no parent is set and - * the authorization credentials belong to an Organization, the parent - * will be set to that Organization. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createProject($project, array $optionalArgs = []) - { - $request = new CreateProjectRequest(); - $request->setProject($project); - return $this->startOperationsCall('CreateProject', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Marks the project identified by the specified - * `name` (for example, `projects/415104041262`) for deletion. - * - * This method will only affect the project if it has a lifecycle state of - * [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE]. - * - * This method changes the Project's lifecycle state from - * [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] - * to - * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. - * The deletion starts at an unspecified time, - * at which point the Project is no longer accessible. - * - * Until the deletion completes, you can check the lifecycle state - * checked by retrieving the project with [GetProject] - * [google.cloud.resourcemanager.v3.Projects.GetProject], - * and the project remains visible to [ListProjects] - * [google.cloud.resourcemanager.v3.Projects.ListProjects]. - * However, you cannot update the project. - * - * After the deletion completes, the project is not retrievable by - * the [GetProject] - * [google.cloud.resourcemanager.v3.Projects.GetProject], - * [ListProjects] - * [google.cloud.resourcemanager.v3.Projects.ListProjects], and - * [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] - * methods. - * - * This method behaves idempotently, such that deleting a `DELETE_REQUESTED` - * project will not cause an error, but also won't do anything. - * - * The caller must have `resourcemanager.projects.delete` permissions for this - * project. - * - * Sample code: - * ``` - * $projectsClient = new ProjectsClient(); - * try { - * $formattedName = $projectsClient->projectName('[PROJECT]'); - * $operationResponse = $projectsClient->deleteProject($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $projectsClient->deleteProject($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'deleteProject'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $projectsClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Project (for example, `projects/415104041262`). - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteProject($name, array $optionalArgs = []) - { - $request = new DeleteProjectRequest(); - $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->startOperationsCall('DeleteProject', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Returns the IAM access control policy for the specified project, in the - * format `projects/{ProjectIdOrNumber}` e.g. projects/123. - * Permission is denied if the policy or the resource do not exist. - * - * Sample code: - * ``` - * $projectsClient = new ProjectsClient(); - * try { - * $resource = 'resource'; - * $response = $projectsClient->getIamPolicy($resource); - * } finally { - * $projectsClient->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(); - } - - /** - * Retrieves the project identified by the specified `name` (for example, - * `projects/415104041262`). - * - * The caller must have `resourcemanager.projects.get` permission - * for this project. - * - * Sample code: - * ``` - * $projectsClient = new ProjectsClient(); - * try { - * $formattedName = $projectsClient->projectName('[PROJECT]'); - * $response = $projectsClient->getProject($formattedName); - * } finally { - * $projectsClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the project (for example, `projects/415104041262`). - * @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\ResourceManager\V3\Project - * - * @throws ApiException if the remote call fails - */ - public function getProject($name, array $optionalArgs = []) - { - $request = new GetProjectRequest(); - $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('GetProject', Project::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists projects that are direct children of the specified folder or - * organization resource. `list()` provides a strongly consistent view of the - * projects underneath the specified parent resource. `list()` returns - * projects sorted based upon the (ascending) lexical ordering of their - * `display_name`. The caller must have `resourcemanager.projects.list` - * permission on the identified parent. - * - * Sample code: - * ``` - * $projectsClient = new ProjectsClient(); - * try { - * $parent = 'parent'; - * // Iterate over pages of elements - * $pagedResponse = $projectsClient->listProjects($parent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $projectsClient->listProjects($parent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $projectsClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource whose projects are being listed. - * Only children of this parent resource are listed; descendants are not - * listed. - * - * If the parent is a folder, use the value `folders/{folder_id}`. If the - * parent is an organization, use the value `organizations/{org_id}`. - * @param array $optionalArgs { - * Optional. - * - * @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 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 bool $showDeleted - * Optional. Indicate that projects in the `DELETE_REQUESTED` state should - * also be returned. Normally only `ACTIVE` projects are returned. - * @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 listProjects($parent, array $optionalArgs = []) - { - $request = new ListProjectsRequest(); - $request->setParent($parent); - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['showDeleted'])) { - $request->setShowDeleted($optionalArgs['showDeleted']); - } - - return $this->getPagedListResponse('ListProjects', $optionalArgs, ListProjectsResponse::class, $request); - } - - /** - * Move a project to another place in your resource hierarchy, under a new - * resource parent. - * - * Returns an operation which can be used to track the process of the project - * move workflow. - * Upon success, the `Operation.response` field will be populated with the - * moved project. - * - * The caller must have `resourcemanager.projects.move` permission on the - * project, on the project's current and proposed new parent. - * - * If project has no current parent, or it currently does not have an - * associated organization resource, you will also need the - * `resourcemanager.projects.setIamPolicy` permission in the project. - * - * - * - * Sample code: - * ``` - * $projectsClient = new ProjectsClient(); - * try { - * $formattedName = $projectsClient->projectName('[PROJECT]'); - * $destinationParent = 'destination_parent'; - * $operationResponse = $projectsClient->moveProject($formattedName, $destinationParent); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $projectsClient->moveProject($formattedName, $destinationParent); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'moveProject'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $projectsClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the project to move. - * @param string $destinationParent Required. The new parent to move the Project under. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function moveProject($name, $destinationParent, array $optionalArgs = []) - { - $request = new MoveProjectRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setDestinationParent($destinationParent); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('MoveProject', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Search for projects that the caller has both `resourcemanager.projects.get` - * permission on, and also satisfy the specified query. - * - * This method returns projects in an unspecified order. - * - * This method is eventually consistent with project mutations; this means - * that a newly created project may not appear in the results or recent - * updates to an existing project may not be reflected in the results. To - * retrieve the latest state of a project, use the - * [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject] method. - * - * Sample code: - * ``` - * $projectsClient = new ProjectsClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $projectsClient->searchProjects(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $projectsClient->searchProjects(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $projectsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $query - * Optional. A query string for searching for projects that the caller has - * `resourcemanager.projects.get` permission to. If multiple fields are - * included in the query, then it will return results that match any of the - * fields. Some eligible fields are: - * - * - **`displayName`, `name`**: Filters by displayName. - * - **`parent`**: Project's parent (for example: `folders/123`, - * `organizations/*`). Prefer `parent` field over `parent.type` and - * `parent.id`. - * - **`parent.type`**: Parent's type: `folder` or `organization`. - * - **`parent.id`**: Parent's id number (for example: `123`). - * - **`id`, `projectId`**: Filters by projectId. - * - **`state`, `lifecycleState`**: Filters by state. - * - **`labels`**: Filters by label name or value. - * - **`labels.` (where `` is the name of a label)**: Filters by label - * name. - * - * Search expressions are case insensitive. - * - * Some examples queries: - * - * - * - **`name:how*`**: The project's name starts with "how". - * - **`name:Howl`**: The project's name is `Howl` or `howl`. - * - **`name:HOWL`**: Equivalent to above. - * - **`NAME:howl`**: Equivalent to above. - * - **`labels.color:*`**: The project has the label `color`. - * - **`labels.color:red`**: The project's label `color` has the value `red`. - * - **`labels.color:red labels.size:big`**: The project's label `color` has - * the value `red` or its label `size` has the value `big`. - * - * If no query is specified, the call will return projects for which the user - * has the `resourcemanager.projects.get` permission. - * @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 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 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 searchProjects(array $optionalArgs = []) - { - $request = new SearchProjectsRequest(); - if (isset($optionalArgs['query'])) { - $request->setQuery($optionalArgs['query']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - return $this->getPagedListResponse('SearchProjects', $optionalArgs, SearchProjectsResponse::class, $request); - } - - /** - * Sets the IAM access control policy for the specified project, in the - * format `projects/{ProjectIdOrNumber}` e.g. projects/123. - * - * CAUTION: This method will replace the existing policy, and cannot be used - * to append additional IAM settings. - * - * Note: Removing service accounts from policies or changing their roles can - * render services completely inoperable. It is important to understand how - * the service account is being used before removing or updating its roles. - * - * The following constraints apply when using `setIamPolicy()`: - * - * + Project does not support `allUsers` and `allAuthenticatedUsers` as - * `members` in a `Binding` of a `Policy`. - * - * + The owner role can be granted to a `user`, `serviceAccount`, or a group - * that is part of an organization. For example, - * group@myownpersonaldomain.com could be added as an owner to a project in - * the myownpersonaldomain.com organization, but not the examplepetstore.com - * organization. - * - * + Service accounts can be made owners of a project directly - * without any restrictions. However, to be added as an owner, a user must be - * invited using the Cloud Platform console and must accept the invitation. - * - * + A user cannot be granted the owner role using `setIamPolicy()`. The user - * must be granted the owner role using the Cloud Platform Console and must - * explicitly accept the invitation. - * - * + Invitations to grant the owner role cannot be sent using - * `setIamPolicy()`; - * they must be sent only using the Cloud Platform Console. - * - * + If the project is not part of an organization, there must be at least - * one owner who has accepted the Terms of Service (ToS) agreement in the - * policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner - * from the policy will fail. This restriction also applies to legacy - * projects that no longer have owners who have accepted the ToS. Edits to - * IAM policies will be rejected until the lack of a ToS-accepting owner is - * rectified. If the project is part of an organization, you can remove all - * owners, potentially making the organization inaccessible. - * - * Sample code: - * ``` - * $projectsClient = new ProjectsClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $projectsClient->setIamPolicy($resource, $policy); - * } finally { - * $projectsClient->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(); - } - - /** - * Returns permissions that a caller has on the specified project, in the - * format `projects/{ProjectIdOrNumber}` e.g. projects/123.. - * - * Sample code: - * ``` - * $projectsClient = new ProjectsClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $projectsClient->testIamPermissions($resource, $permissions); - * } finally { - * $projectsClient->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(); - } - - /** - * Restores the project identified by the specified - * `name` (for example, `projects/415104041262`). - * You can only use this method for a project that has a lifecycle state of - * [DELETE_REQUESTED] - * [Projects.State.DELETE_REQUESTED]. - * After deletion starts, the project cannot be restored. - * - * The caller must have `resourcemanager.projects.undelete` permission for - * this project. - * - * Sample code: - * ``` - * $projectsClient = new ProjectsClient(); - * try { - * $formattedName = $projectsClient->projectName('[PROJECT]'); - * $operationResponse = $projectsClient->undeleteProject($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $projectsClient->undeleteProject($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'undeleteProject'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $projectsClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the project (for example, `projects/415104041262`). - * - * Required. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function undeleteProject($name, array $optionalArgs = []) - { - $request = new UndeleteProjectRequest(); - $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->startOperationsCall('UndeleteProject', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the `display_name` and labels of the project identified by the - * specified `name` (for example, `projects/415104041262`). Deleting all - * labels requires an update mask for labels field. - * - * The caller must have `resourcemanager.projects.update` permission for this - * project. - * - * Sample code: - * ``` - * $projectsClient = new ProjectsClient(); - * try { - * $project = new Project(); - * $operationResponse = $projectsClient->updateProject($project); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $projectsClient->updateProject($project); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'updateProject'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $projectsClient->close(); - * } - * ``` - * - * @param Project $project Required. The new definition of the project. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. An update mask to selectively update fields. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateProject($project, array $optionalArgs = []) - { - $request = new UpdateProjectRequest(); - $requestParamHeaders = []; - $request->setProject($project); - $requestParamHeaders['project.name'] = $project->getName(); - 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->startOperationsCall('UpdateProject', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagBindingsGapicClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagBindingsGapicClient.php deleted file mode 100644 index 707b98efe90c..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagBindingsGapicClient.php +++ /dev/null @@ -1,574 +0,0 @@ -createTagBinding($tagBinding); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tagBindingsClient->createTagBinding($tagBinding); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tagBindingsClient->resumeOperation($operationName, 'createTagBinding'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tagBindingsClient->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. - */ -class TagBindingsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.resourcemanager.v3.TagBindings'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'cloudresourcemanager.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', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private static $tagBindingNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/tag_bindings_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/tag_bindings_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/tag_bindings_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/tag_bindings_rest_client_config.php', - ], - ], - ]; - } - - private static function getTagBindingNameTemplate() - { - if (self::$tagBindingNameTemplate == null) { - self::$tagBindingNameTemplate = new PathTemplate('tagBindings/{tag_binding}'); - } - - return self::$tagBindingNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'tagBinding' => self::getTagBindingNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a tag_binding - * resource. - * - * @param string $tagBinding - * - * @return string The formatted tag_binding resource. - */ - public static function tagBindingName($tagBinding) - { - return self::getTagBindingNameTemplate()->render([ - 'tag_binding' => $tagBinding, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - tagBinding: tagBindings/{tag_binding} - * - * 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"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 'cloudresourcemanager.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); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a TagBinding between a TagValue and a Google Cloud resource. - * - * Sample code: - * ``` - * $tagBindingsClient = new TagBindingsClient(); - * try { - * $tagBinding = new TagBinding(); - * $operationResponse = $tagBindingsClient->createTagBinding($tagBinding); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tagBindingsClient->createTagBinding($tagBinding); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tagBindingsClient->resumeOperation($operationName, 'createTagBinding'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tagBindingsClient->close(); - * } - * ``` - * - * @param TagBinding $tagBinding Required. The TagBinding to be created. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createTagBinding($tagBinding, array $optionalArgs = []) - { - $request = new CreateTagBindingRequest(); - $request->setTagBinding($tagBinding); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - return $this->startOperationsCall('CreateTagBinding', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a TagBinding. - * - * Sample code: - * ``` - * $tagBindingsClient = new TagBindingsClient(); - * try { - * $formattedName = $tagBindingsClient->tagBindingName('[TAG_BINDING]'); - * $operationResponse = $tagBindingsClient->deleteTagBinding($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tagBindingsClient->deleteTagBinding($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tagBindingsClient->resumeOperation($operationName, 'deleteTagBinding'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tagBindingsClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the TagBinding. This is a String of the form: - * `tagBindings/{id}` (e.g. - * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteTagBinding($name, array $optionalArgs = []) - { - $request = new DeleteTagBindingRequest(); - $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->startOperationsCall('DeleteTagBinding', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Return a list of effective tags for the given Google Cloud resource, as - * specified in `parent`. - * - * Sample code: - * ``` - * $tagBindingsClient = new TagBindingsClient(); - * try { - * $parent = 'parent'; - * // Iterate over pages of elements - * $pagedResponse = $tagBindingsClient->listEffectiveTags($parent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $tagBindingsClient->listEffectiveTags($parent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $tagBindingsClient->close(); - * } - * ``` - * - * @param string $parent Required. The full resource name of a resource for which you want to list - * the effective tags. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * @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 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 listEffectiveTags($parent, array $optionalArgs = []) - { - $request = new ListEffectiveTagsRequest(); - $request->setParent($parent); - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - return $this->getPagedListResponse('ListEffectiveTags', $optionalArgs, ListEffectiveTagsResponse::class, $request); - } - - /** - * Lists the TagBindings for the given Google Cloud resource, as specified - * with `parent`. - * - * NOTE: The `parent` field is expected to be a full resource name: - * https://cloud.google.com/apis/design/resource_names#full_resource_name - * - * Sample code: - * ``` - * $tagBindingsClient = new TagBindingsClient(); - * try { - * $parent = 'parent'; - * // Iterate over pages of elements - * $pagedResponse = $tagBindingsClient->listTagBindings($parent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $tagBindingsClient->listTagBindings($parent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $tagBindingsClient->close(); - * } - * ``` - * - * @param string $parent Required. The full resource name of a resource for which you want to list - * existing TagBindings. E.g. - * "//cloudresourcemanager.googleapis.com/projects/123" - * @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 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 listTagBindings($parent, array $optionalArgs = []) - { - $request = new ListTagBindingsRequest(); - $request->setParent($parent); - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - return $this->getPagedListResponse('ListTagBindings', $optionalArgs, ListTagBindingsResponse::class, $request); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagHoldsGapicClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagHoldsGapicClient.php deleted file mode 100644 index af887171c517..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagHoldsGapicClient.php +++ /dev/null @@ -1,569 +0,0 @@ -tagValueName('[TAG_VALUE]'); - * $tagHold = new TagHold(); - * $operationResponse = $tagHoldsClient->createTagHold($formattedParent, $tagHold); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tagHoldsClient->createTagHold($formattedParent, $tagHold); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tagHoldsClient->resumeOperation($operationName, 'createTagHold'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tagHoldsClient->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. - */ -class TagHoldsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.resourcemanager.v3.TagHolds'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'cloudresourcemanager.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', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private static $tagHoldNameTemplate; - - private static $tagValueNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/tag_holds_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/tag_holds_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/tag_holds_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/tag_holds_rest_client_config.php', - ], - ], - ]; - } - - private static function getTagHoldNameTemplate() - { - if (self::$tagHoldNameTemplate == null) { - self::$tagHoldNameTemplate = new PathTemplate('tagValues/{tag_value}/tagHolds/{tag_hold}'); - } - - return self::$tagHoldNameTemplate; - } - - private static function getTagValueNameTemplate() - { - if (self::$tagValueNameTemplate == null) { - self::$tagValueNameTemplate = new PathTemplate('tagValues/{tag_value}'); - } - - return self::$tagValueNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'tagHold' => self::getTagHoldNameTemplate(), - 'tagValue' => self::getTagValueNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a tag_hold - * resource. - * - * @param string $tagValue - * @param string $tagHold - * - * @return string The formatted tag_hold resource. - */ - public static function tagHoldName($tagValue, $tagHold) - { - return self::getTagHoldNameTemplate()->render([ - 'tag_value' => $tagValue, - 'tag_hold' => $tagHold, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a tag_value - * resource. - * - * @param string $tagValue - * - * @return string The formatted tag_value resource. - */ - public static function tagValueName($tagValue) - { - return self::getTagValueNameTemplate()->render([ - 'tag_value' => $tagValue, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - tagHold: tagValues/{tag_value}/tagHolds/{tag_hold} - * - tagValue: tagValues/{tag_value} - * - * 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"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 'cloudresourcemanager.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); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same - * resource and origin exists under the same TagValue. - * - * Sample code: - * ``` - * $tagHoldsClient = new TagHoldsClient(); - * try { - * $formattedParent = $tagHoldsClient->tagValueName('[TAG_VALUE]'); - * $tagHold = new TagHold(); - * $operationResponse = $tagHoldsClient->createTagHold($formattedParent, $tagHold); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tagHoldsClient->createTagHold($formattedParent, $tagHold); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tagHoldsClient->resumeOperation($operationName, 'createTagHold'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tagHoldsClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the TagHold's parent TagValue. Must be of - * the form: `tagValues/{tag-value-id}`. - * @param TagHold $tagHold Required. The TagHold to be created. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Set to true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createTagHold($parent, $tagHold, array $optionalArgs = []) - { - $request = new CreateTagHoldRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTagHold($tagHold); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateTagHold', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a TagHold. - * - * Sample code: - * ``` - * $tagHoldsClient = new TagHoldsClient(); - * try { - * $formattedName = $tagHoldsClient->tagHoldName('[TAG_VALUE]', '[TAG_HOLD]'); - * $operationResponse = $tagHoldsClient->deleteTagHold($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tagHoldsClient->deleteTagHold($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tagHoldsClient->resumeOperation($operationName, 'deleteTagHold'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tagHoldsClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the TagHold to delete. Must be of the form: - * `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Set to true to perform the validations necessary for deleting the - * resource, but not actually perform the action. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteTagHold($name, array $optionalArgs = []) - { - $request = new DeleteTagHoldRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteTagHold', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Lists TagHolds under a TagValue. - * - * Sample code: - * ``` - * $tagHoldsClient = new TagHoldsClient(); - * try { - * $formattedParent = $tagHoldsClient->tagValueName('[TAG_VALUE]'); - * // Iterate over pages of elements - * $pagedResponse = $tagHoldsClient->listTagHolds($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $tagHoldsClient->listTagHolds($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $tagHoldsClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the parent TagValue. Must be of the form: - * `tagValues/{tag-value-id}`. - * @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. Criteria used to select a subset of TagHolds parented by the - * TagValue to return. This field follows the syntax defined by aip.dev/160; - * the `holder` and `origin` fields are supported for filtering. Currently - * only `AND` syntax is supported. Some example queries are: - * - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - * * `origin = 35678234` - * * `holder = - * //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group - * AND origin = 35678234` - * @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 listTagHolds($parent, array $optionalArgs = []) - { - $request = new ListTagHoldsRequest(); - $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']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListTagHolds', $optionalArgs, ListTagHoldsResponse::class, $request); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagKeysGapicClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagKeysGapicClient.php deleted file mode 100644 index 140f7888bd6a..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagKeysGapicClient.php +++ /dev/null @@ -1,856 +0,0 @@ -createTagKey($tagKey); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tagKeysClient->createTagKey($tagKey); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tagKeysClient->resumeOperation($operationName, 'createTagKey'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tagKeysClient->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. - */ -class TagKeysGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.resourcemanager.v3.TagKeys'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'cloudresourcemanager.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', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private static $tagKeyNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/tag_keys_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/tag_keys_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/tag_keys_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/tag_keys_rest_client_config.php', - ], - ], - ]; - } - - private static function getTagKeyNameTemplate() - { - if (self::$tagKeyNameTemplate == null) { - self::$tagKeyNameTemplate = new PathTemplate('tagKeys/{tag_key}'); - } - - return self::$tagKeyNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'tagKey' => self::getTagKeyNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a tag_key - * resource. - * - * @param string $tagKey - * - * @return string The formatted tag_key resource. - */ - public static function tagKeyName($tagKey) - { - return self::getTagKeyNameTemplate()->render([ - 'tag_key' => $tagKey, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - tagKey: tagKeys/{tag_key} - * - * 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"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 'cloudresourcemanager.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); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a new TagKey. If another request with the same parameters is - * sent while the original request is in process, the second request - * will receive an error. A maximum of 1000 TagKeys can exist under a parent - * at any given time. - * - * Sample code: - * ``` - * $tagKeysClient = new TagKeysClient(); - * try { - * $tagKey = new TagKey(); - * $operationResponse = $tagKeysClient->createTagKey($tagKey); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tagKeysClient->createTagKey($tagKey); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tagKeysClient->resumeOperation($operationName, 'createTagKey'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tagKeysClient->close(); - * } - * ``` - * - * @param TagKey $tagKey Required. The TagKey to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Set to true to perform validations necessary for creating the - * resource, but not actually perform the action. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createTagKey($tagKey, array $optionalArgs = []) - { - $request = new CreateTagKeyRequest(); - $request->setTagKey($tagKey); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - return $this->startOperationsCall('CreateTagKey', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a TagKey. The TagKey cannot be deleted if it has any child - * TagValues. - * - * Sample code: - * ``` - * $tagKeysClient = new TagKeysClient(); - * try { - * $formattedName = $tagKeysClient->tagKeyName('[TAG_KEY]'); - * $operationResponse = $tagKeysClient->deleteTagKey($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tagKeysClient->deleteTagKey($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tagKeysClient->resumeOperation($operationName, 'deleteTagKey'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tagKeysClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of a TagKey to be deleted in the format - * `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or - * it will not be deleted successfully. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Set as true to perform validations necessary for deletion, but - * not actually perform the action. - * @type string $etag - * Optional. The etag known to the client for the expected state of the - * TagKey. This is to be used for optimistic concurrency. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteTagKey($name, array $optionalArgs = []) - { - $request = new DeleteTagKeyRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteTagKey', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets the access control policy for a TagKey. The returned policy may be - * empty if no such policy or resource exists. The `resource` field should - * be the TagKey's resource name. For example, "tagKeys/1234". - * The caller must have - * `cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy` permission on - * the specified TagKey. - * - * Sample code: - * ``` - * $tagKeysClient = new TagKeysClient(); - * try { - * $resource = 'resource'; - * $response = $tagKeysClient->getIamPolicy($resource); - * } finally { - * $tagKeysClient->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(); - } - - /** - * Retrieves a TagKey by its namespaced name. - * This method will return `PERMISSION_DENIED` if the key does not exist - * or the user does not have permission to view it. - * - * Sample code: - * ``` - * $tagKeysClient = new TagKeysClient(); - * try { - * $formattedName = $tagKeysClient->tagKeyName('[TAG_KEY]'); - * $response = $tagKeysClient->getNamespacedTagKey($formattedName); - * } finally { - * $tagKeysClient->close(); - * } - * ``` - * - * @param string $name Required. A namespaced tag key name in the format - * `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name - * "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short - * name "bar" under the project `r2-d2`. - * @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\ResourceManager\V3\TagKey - * - * @throws ApiException if the remote call fails - */ - public function getNamespacedTagKey($name, array $optionalArgs = []) - { - $request = new GetNamespacedTagKeyRequest(); - $request->setName($name); - return $this->startCall('GetNamespacedTagKey', TagKey::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves a TagKey. This method will return `PERMISSION_DENIED` if the - * key does not exist or the user does not have permission to view it. - * - * Sample code: - * ``` - * $tagKeysClient = new TagKeysClient(); - * try { - * $formattedName = $tagKeysClient->tagKeyName('[TAG_KEY]'); - * $response = $tagKeysClient->getTagKey($formattedName); - * } finally { - * $tagKeysClient->close(); - * } - * ``` - * - * @param string $name Required. A resource name in the format `tagKeys/{id}`, such as - * `tagKeys/123`. - * @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\ResourceManager\V3\TagKey - * - * @throws ApiException if the remote call fails - */ - public function getTagKey($name, array $optionalArgs = []) - { - $request = new GetTagKeyRequest(); - $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('GetTagKey', TagKey::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists all TagKeys for a parent resource. - * - * Sample code: - * ``` - * $tagKeysClient = new TagKeysClient(); - * try { - * $parent = 'parent'; - * // Iterate over pages of elements - * $pagedResponse = $tagKeysClient->listTagKeys($parent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $tagKeysClient->listTagKeys($parent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $tagKeysClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the TagKey's parent. - * Must be of the form `organizations/{org_id}` or `projects/{project_id}` or - * `projects/{project_number}` - * @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 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 listTagKeys($parent, array $optionalArgs = []) - { - $request = new ListTagKeysRequest(); - $request->setParent($parent); - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - return $this->getPagedListResponse('ListTagKeys', $optionalArgs, ListTagKeysResponse::class, $request); - } - - /** - * Sets the access control policy on a TagKey, replacing any existing - * policy. The `resource` field should be the TagKey's resource name. - * For example, "tagKeys/1234". - * The caller must have `resourcemanager.tagKeys.setIamPolicy` permission - * on the identified tagValue. - * - * Sample code: - * ``` - * $tagKeysClient = new TagKeysClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $tagKeysClient->setIamPolicy($resource, $policy); - * } finally { - * $tagKeysClient->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(); - } - - /** - * Returns permissions that a caller has on the specified TagKey. - * The `resource` field should be the TagKey's resource name. - * For example, "tagKeys/1234". - * - * There are no permissions required for making this API call. - * - * Sample code: - * ``` - * $tagKeysClient = new TagKeysClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $tagKeysClient->testIamPermissions($resource, $permissions); - * } finally { - * $tagKeysClient->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 the attributes of the TagKey resource. - * - * Sample code: - * ``` - * $tagKeysClient = new TagKeysClient(); - * try { - * $tagKey = new TagKey(); - * $operationResponse = $tagKeysClient->updateTagKey($tagKey); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tagKeysClient->updateTagKey($tagKey); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tagKeysClient->resumeOperation($operationName, 'updateTagKey'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tagKeysClient->close(); - * } - * ``` - * - * @param TagKey $tagKey Required. The new definition of the TagKey. Only the `description` and - * `etag` fields can be updated by this request. If the `etag` field is not - * empty, it must match the `etag` field of the existing tag key. Otherwise, - * `ABORTED` will be returned. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Fields to be updated. The mask may only contain `description` or - * `etag`. If omitted entirely, both `description` and `etag` are assumed to - * be significant. - * @type bool $validateOnly - * Set as true to perform validations necessary for updating the resource, but - * not actually perform the action. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateTagKey($tagKey, array $optionalArgs = []) - { - $request = new UpdateTagKeyRequest(); - $requestParamHeaders = []; - $request->setTagKey($tagKey); - $requestParamHeaders['tag_key.name'] = $tagKey->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateTagKey', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagValuesGapicClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagValuesGapicClient.php deleted file mode 100644 index f0110578e16f..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/Gapic/TagValuesGapicClient.php +++ /dev/null @@ -1,856 +0,0 @@ -createTagValue($tagValue); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tagValuesClient->createTagValue($tagValue); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tagValuesClient->resumeOperation($operationName, 'createTagValue'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tagValuesClient->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. - */ -class TagValuesGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.resourcemanager.v3.TagValues'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'cloudresourcemanager.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', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private static $tagValueNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/tag_values_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/tag_values_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/tag_values_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/tag_values_rest_client_config.php', - ], - ], - ]; - } - - private static function getTagValueNameTemplate() - { - if (self::$tagValueNameTemplate == null) { - self::$tagValueNameTemplate = new PathTemplate('tagValues/{tag_value}'); - } - - return self::$tagValueNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'tagValue' => self::getTagValueNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a tag_value - * resource. - * - * @param string $tagValue - * - * @return string The formatted tag_value resource. - */ - public static function tagValueName($tagValue) - { - return self::getTagValueNameTemplate()->render([ - 'tag_value' => $tagValue, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - tagValue: tagValues/{tag_value} - * - * 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"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 'cloudresourcemanager.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); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a TagValue as a child of the specified TagKey. If a another - * request with the same parameters is sent while the original request is in - * process the second request will receive an error. A maximum of 1000 - * TagValues can exist under a TagKey at any given time. - * - * Sample code: - * ``` - * $tagValuesClient = new TagValuesClient(); - * try { - * $tagValue = new TagValue(); - * $operationResponse = $tagValuesClient->createTagValue($tagValue); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tagValuesClient->createTagValue($tagValue); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tagValuesClient->resumeOperation($operationName, 'createTagValue'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tagValuesClient->close(); - * } - * ``` - * - * @param TagValue $tagValue Required. The TagValue to be created. Only fields `short_name`, - * `description`, and `parent` are considered during the creation request. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Set as true to perform the validations necessary for creating the - * resource, but not actually perform the action. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createTagValue($tagValue, array $optionalArgs = []) - { - $request = new CreateTagValueRequest(); - $request->setTagValue($tagValue); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - return $this->startOperationsCall('CreateTagValue', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a TagValue. The TagValue cannot have any bindings when it is - * deleted. - * - * Sample code: - * ``` - * $tagValuesClient = new TagValuesClient(); - * try { - * $formattedName = $tagValuesClient->tagValueName('[TAG_VALUE]'); - * $operationResponse = $tagValuesClient->deleteTagValue($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tagValuesClient->deleteTagValue($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tagValuesClient->resumeOperation($operationName, 'deleteTagValue'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tagValuesClient->close(); - * } - * ``` - * - * @param string $name Required. Resource name for TagValue to be deleted in the format - * tagValues/456. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * Optional. Set as true to perform the validations necessary for deletion, - * but not actually perform the action. - * @type string $etag - * Optional. The etag known to the client for the expected state of the - * TagValue. This is to be used for optimistic concurrency. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteTagValue($name, array $optionalArgs = []) - { - $request = new DeleteTagValueRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteTagValue', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets the access control policy for a TagValue. The returned policy may be - * empty if no such policy or resource exists. The `resource` field should - * be the TagValue's resource name. For example: `tagValues/1234`. - * The caller must have the - * `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on - * the identified TagValue to get the access control policy. - * - * Sample code: - * ``` - * $tagValuesClient = new TagValuesClient(); - * try { - * $resource = 'resource'; - * $response = $tagValuesClient->getIamPolicy($resource); - * } finally { - * $tagValuesClient->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(); - } - - /** - * Retrieves a TagValue by its namespaced name. - * This method will return `PERMISSION_DENIED` if the value does not exist - * or the user does not have permission to view it. - * - * Sample code: - * ``` - * $tagValuesClient = new TagValuesClient(); - * try { - * $formattedName = $tagValuesClient->tagValueName('[TAG_VALUE]'); - * $response = $tagValuesClient->getNamespacedTagValue($formattedName); - * } finally { - * $tagValuesClient->close(); - * } - * ``` - * - * @param string $name Required. A namespaced tag value name in the following format: - * - * `{parentId}/{tagKeyShort}/{tagValueShort}` - * - * Examples: - * - `42/foo/abc` for a value with short name "abc" under the key with short - * name "foo" under the organization with ID 42 - * - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with - * short name "bar" under the project with ID "r2-d2" - * @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\ResourceManager\V3\TagValue - * - * @throws ApiException if the remote call fails - */ - public function getNamespacedTagValue($name, array $optionalArgs = []) - { - $request = new GetNamespacedTagValueRequest(); - $request->setName($name); - return $this->startCall('GetNamespacedTagValue', TagValue::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the - * value does not exist or the user does not have permission to view it. - * - * Sample code: - * ``` - * $tagValuesClient = new TagValuesClient(); - * try { - * $formattedName = $tagValuesClient->tagValueName('[TAG_VALUE]'); - * $response = $tagValuesClient->getTagValue($formattedName); - * } finally { - * $tagValuesClient->close(); - * } - * ``` - * - * @param string $name Required. Resource name for TagValue to be fetched in the format - * `tagValues/456`. - * @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\ResourceManager\V3\TagValue - * - * @throws ApiException if the remote call fails - */ - public function getTagValue($name, array $optionalArgs = []) - { - $request = new GetTagValueRequest(); - $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('GetTagValue', TagValue::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists all TagValues for a specific TagKey. - * - * Sample code: - * ``` - * $tagValuesClient = new TagValuesClient(); - * try { - * $parent = 'parent'; - * // Iterate over pages of elements - * $pagedResponse = $tagValuesClient->listTagValues($parent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $tagValuesClient->listTagValues($parent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $tagValuesClient->close(); - * } - * ``` - * - * @param string $parent Required. - * @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 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 listTagValues($parent, array $optionalArgs = []) - { - $request = new ListTagValuesRequest(); - $request->setParent($parent); - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - return $this->getPagedListResponse('ListTagValues', $optionalArgs, ListTagValuesResponse::class, $request); - } - - /** - * Sets the access control policy on a TagValue, replacing any existing - * policy. The `resource` field should be the TagValue's resource name. - * For example: `tagValues/1234`. - * The caller must have `resourcemanager.tagValues.setIamPolicy` permission - * on the identified tagValue. - * - * Sample code: - * ``` - * $tagValuesClient = new TagValuesClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $tagValuesClient->setIamPolicy($resource, $policy); - * } finally { - * $tagValuesClient->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(); - } - - /** - * Returns permissions that a caller has on the specified TagValue. - * The `resource` field should be the TagValue's resource name. For example: - * `tagValues/1234`. - * - * There are no permissions required for making this API call. - * - * Sample code: - * ``` - * $tagValuesClient = new TagValuesClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $tagValuesClient->testIamPermissions($resource, $permissions); - * } finally { - * $tagValuesClient->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 the attributes of the TagValue resource. - * - * Sample code: - * ``` - * $tagValuesClient = new TagValuesClient(); - * try { - * $tagValue = new TagValue(); - * $operationResponse = $tagValuesClient->updateTagValue($tagValue); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $tagValuesClient->updateTagValue($tagValue); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $tagValuesClient->resumeOperation($operationName, 'updateTagValue'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $tagValuesClient->close(); - * } - * ``` - * - * @param TagValue $tagValue Required. The new definition of the TagValue. Only fields `description` and - * `etag` fields can be updated by this request. If the `etag` field is - * nonempty, it must match the `etag` field of the existing ControlGroup. - * Otherwise, `ABORTED` will be returned. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Fields to be updated. - * @type bool $validateOnly - * Optional. True to perform validations necessary for updating the resource, - * but not actually perform the action. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateTagValue($tagValue, array $optionalArgs = []) - { - $request = new UpdateTagValueRequest(); - $requestParamHeaders = []; - $request->setTagValue($tagValue); - $requestParamHeaders['tag_value.name'] = $tagValue->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateTagValue', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/OrganizationsClient.php b/owl-bot-staging/ResourceManager/v3/src/V3/OrganizationsClient.php deleted file mode 100644 index 59e97e3989a2..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/OrganizationsClient.php +++ /dev/null @@ -1,34 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.Folders' => [ - 'CreateFolder' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateFolderMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteFolder' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteFolderMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'MoveFolder' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\MoveFolderMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UndeleteFolder' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UndeleteFolderMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateFolder' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Folder', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UpdateFolderMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListFolders' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getFolders', - ], - ], - 'SearchFolders' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getFolders', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_rest_client_config.php deleted file mode 100644 index 207e25e6815d..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/folders_rest_client_config.php +++ /dev/null @@ -1,136 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.Folders' => [ - 'CreateFolder' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/folders', - 'body' => 'folder', - ], - 'DeleteFolder' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=folders/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetFolder' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=folders/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=folders/*}:getIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'ListFolders' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/folders', - 'queryParams' => [ - 'parent', - ], - ], - 'MoveFolder' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{name=folders/*}:move', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'SearchFolders' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/folders:search', - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=folders/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=folders/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'UndeleteFolder' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{name=folders/*}:undelete', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateFolder' => [ - 'method' => 'patch', - 'uriTemplate' => '/v3/{folder.name=folders/*}', - 'body' => 'folder', - 'placeholders' => [ - 'folder.name' => [ - 'getters' => [ - 'getFolder', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=operations/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_client_config.json deleted file mode 100644 index cd3f3bc9c021..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_client_config.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "interfaces": { - "google.cloud.resourcemanager.v3.Organizations": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "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": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetOrganization": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SearchOrganizations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_descriptor_config.php deleted file mode 100644 index 517a2fee2f3a..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_descriptor_config.php +++ /dev/null @@ -1,18 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.Organizations' => [ - 'SearchOrganizations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getOrganizations', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_rest_client_config.php deleted file mode 100644 index ac91964986fa..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/organizations_rest_client_config.php +++ /dev/null @@ -1,73 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.Organizations' => [ - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=organizations/*}:getIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'GetOrganization' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=organizations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'SearchOrganizations' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/organizations:search', - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=organizations/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=organizations/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=operations/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_client_config.json deleted file mode 100644 index bf38535bd8a5..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_client_config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "interfaces": { - "google.cloud.resourcemanager.v3.Projects": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "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": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateProject": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteProject": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetProject": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListProjects": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "MoveProject": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "SearchProjects": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UndeleteProject": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateProject": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_descriptor_config.php deleted file mode 100644 index 343e1f75bb50..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_descriptor_config.php +++ /dev/null @@ -1,78 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.Projects' => [ - 'CreateProject' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateProjectMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteProject' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteProjectMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'MoveProject' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\MoveProjectMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UndeleteProject' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UndeleteProjectMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateProject' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\Project', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UpdateProjectMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListProjects' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getProjects', - ], - ], - 'SearchProjects' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getProjects', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_rest_client_config.php deleted file mode 100644 index 0683b4473a2a..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/projects_rest_client_config.php +++ /dev/null @@ -1,133 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.Projects' => [ - 'CreateProject' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/projects', - 'body' => 'project', - ], - 'DeleteProject' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=projects/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=projects/*}:getIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'GetProject' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=projects/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListProjects' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/projects', - 'queryParams' => [ - 'parent', - ], - ], - 'MoveProject' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{name=projects/*}:move', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'SearchProjects' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/projects:search', - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=projects/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=projects/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'UndeleteProject' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{name=projects/*}:undelete', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateProject' => [ - 'method' => 'patch', - 'uriTemplate' => '/v3/{project.name=projects/*}', - 'body' => 'project', - 'placeholders' => [ - 'project.name' => [ - 'getters' => [ - 'getProject', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=operations/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_client_config.json deleted file mode 100644 index 8f187c5e23a3..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_client_config.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "interfaces": { - "google.cloud.resourcemanager.v3.TagBindings": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "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": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateTagBinding": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteTagBinding": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListEffectiveTags": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListTagBindings": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_descriptor_config.php deleted file mode 100644 index d5e99aa90b6e..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_descriptor_config.php +++ /dev/null @@ -1,48 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.TagBindings' => [ - 'CreateTagBinding' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagBinding', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateTagBindingMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteTagBinding' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteTagBindingMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListEffectiveTags' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getEffectiveTags', - ], - ], - 'ListTagBindings' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTagBindings', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_rest_client_config.php deleted file mode 100644 index f7a37f80d839..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_bindings_rest_client_config.php +++ /dev/null @@ -1,52 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.TagBindings' => [ - 'CreateTagBinding' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/tagBindings', - 'body' => 'tag_binding', - ], - 'DeleteTagBinding' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=tagBindings/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListEffectiveTags' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/effectiveTags', - 'queryParams' => [ - 'parent', - ], - ], - 'ListTagBindings' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/tagBindings', - 'queryParams' => [ - 'parent', - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=operations/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_client_config.json deleted file mode 100644 index bf327d859db3..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_client_config.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "interfaces": { - "google.cloud.resourcemanager.v3.TagHolds": { - "retry_codes": { - "no_retry_codes": [] - }, - "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 - } - }, - "methods": { - "CreateTagHold": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteTagHold": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListTagHolds": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_descriptor_config.php deleted file mode 100644 index c7e386d4a935..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_descriptor_config.php +++ /dev/null @@ -1,38 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.TagHolds' => [ - 'CreateTagHold' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagHold', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateTagHoldMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteTagHold' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteTagHoldMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListTagHolds' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTagHolds', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_rest_client_config.php deleted file mode 100644 index 8f1a1fbafe66..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_holds_rest_client_config.php +++ /dev/null @@ -1,56 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.TagHolds' => [ - 'CreateTagHold' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{parent=tagValues/*}/tagHolds', - 'body' => 'tag_hold', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteTagHold' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=tagValues/*/tagHolds/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListTagHolds' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{parent=tagValues/*}/tagHolds', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=operations/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_client_config.json deleted file mode 100644 index 75f389d694a4..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_client_config.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "interfaces": { - "google.cloud.resourcemanager.v3.TagKeys": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "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": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateTagKey": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteTagKey": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetNamespacedTagKey": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetTagKey": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListTagKeys": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateTagKey": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_descriptor_config.php deleted file mode 100644 index 337d4779f7ce..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_descriptor_config.php +++ /dev/null @@ -1,48 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.TagKeys' => [ - 'CreateTagKey' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagKey', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateTagKeyMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteTagKey' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagKey', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteTagKeyMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateTagKey' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagKey', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UpdateTagKeyMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListTagKeys' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTagKeys', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_rest_client_config.php deleted file mode 100644 index 969c16663c34..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_keys_rest_client_config.php +++ /dev/null @@ -1,112 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.TagKeys' => [ - 'CreateTagKey' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/tagKeys', - 'body' => 'tag_key', - ], - 'DeleteTagKey' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=tagKeys/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=tagKeys/*}:getIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'GetNamespacedTagKey' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/tagKeys/namespaced', - 'queryParams' => [ - 'name', - ], - ], - 'GetTagKey' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=tagKeys/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListTagKeys' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/tagKeys', - 'queryParams' => [ - 'parent', - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=tagKeys/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=tagKeys/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'UpdateTagKey' => [ - 'method' => 'patch', - 'uriTemplate' => '/v3/{tag_key.name=tagKeys/*}', - 'body' => 'tag_key', - 'placeholders' => [ - 'tag_key.name' => [ - 'getters' => [ - 'getTagKey', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=operations/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_client_config.json b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_client_config.json deleted file mode 100644 index f9fae4e4bfd0..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_client_config.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "interfaces": { - "google.cloud.resourcemanager.v3.TagValues": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "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": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateTagValue": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteTagValue": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetNamespacedTagValue": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetTagValue": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListTagValues": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateTagValue": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_descriptor_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_descriptor_config.php deleted file mode 100644 index 706c5f124be6..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_descriptor_config.php +++ /dev/null @@ -1,48 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.TagValues' => [ - 'CreateTagValue' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagValue', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\CreateTagValueMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteTagValue' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagValue', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\DeleteTagValueMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateTagValue' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ResourceManager\V3\TagValue', - 'metadataReturnType' => '\Google\Cloud\ResourceManager\V3\UpdateTagValueMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListTagValues' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTagValues', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_rest_client_config.php b/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_rest_client_config.php deleted file mode 100644 index bacaedd72e94..000000000000 --- a/owl-bot-staging/ResourceManager/v3/src/V3/resources/tag_values_rest_client_config.php +++ /dev/null @@ -1,112 +0,0 @@ - [ - 'google.cloud.resourcemanager.v3.TagValues' => [ - 'CreateTagValue' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/tagValues', - 'body' => 'tag_value', - ], - 'DeleteTagValue' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=tagValues/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=tagValues/*}:getIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'GetNamespacedTagValue' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/tagValues/namespaced', - 'queryParams' => [ - 'name', - ], - ], - 'GetTagValue' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=tagValues/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListTagValues' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/tagValues', - 'queryParams' => [ - 'parent', - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=tagValues/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{resource=tagValues/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'UpdateTagValue' => [ - 'method' => 'patch', - 'uriTemplate' => '/v3/{tag_value.name=tagValues/*}', - 'body' => 'tag_value', - 'placeholders' => [ - 'tag_value.name' => [ - 'getters' => [ - 'getTagValue', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=operations/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/FoldersClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/FoldersClientTest.php deleted file mode 100644 index ec2d97e32e3c..000000000000 --- a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/FoldersClientTest.php +++ /dev/null @@ -1,1097 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return FoldersClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new FoldersClient($options); - } - - /** @test */ - public function createFolderTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFolderTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Folder(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createFolderTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $folder = new Folder(); - $folderParent = 'folderParent-1307212104'; - $folder->setParent($folderParent); - $response = $gapicClient->createFolder($folder); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Folders/CreateFolder', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getFolder(); - $this->assertProtobufEquals($folder, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFolderTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createFolderExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFolderTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $folder = new Folder(); - $folderParent = 'folderParent-1307212104'; - $folder->setParent($folderParent); - $response = $gapicClient->createFolder($folder); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFolderTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFolderTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFolderTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Folder(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteFolderTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->folderName('[FOLDER]'); - $response = $gapicClient->deleteFolder($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Folders/DeleteFolder', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFolderTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFolderExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFolderTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->folderName('[FOLDER]'); - $response = $gapicClient->deleteFolder($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFolderTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getFolderTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Folder(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->folderName('[FOLDER]'); - $response = $gapicClient->getFolder($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.resourcemanager.v3.Folders/GetFolder', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFolderExceptionTest() - { - $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->folderName('[FOLDER]'); - try { - $gapicClient->getFolder($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.resourcemanager.v3.Folders/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 listFoldersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $foldersElement = new Folder(); - $folders = [ - $foldersElement, - ]; - $expectedResponse = new ListFoldersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFolders($folders); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $response = $gapicClient->listFolders($parent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFolders()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Folders/ListFolders', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFoldersExceptionTest() - { - $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 - $parent = 'parent-995424086'; - try { - $gapicClient->listFolders($parent); - // 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 moveFolderTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/moveFolderTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Folder(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/moveFolderTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->folderName('[FOLDER]'); - $destinationParent = 'destinationParent-1362053637'; - $response = $gapicClient->moveFolder($formattedName, $destinationParent); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Folders/MoveFolder', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualApiRequestObject->getDestinationParent(); - $this->assertProtobufEquals($destinationParent, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveFolderTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function moveFolderExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/moveFolderTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->folderName('[FOLDER]'); - $destinationParent = 'destinationParent-1362053637'; - $response = $gapicClient->moveFolder($formattedName, $destinationParent); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveFolderTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function searchFoldersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $foldersElement = new Folder(); - $folders = [ - $foldersElement, - ]; - $expectedResponse = new SearchFoldersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFolders($folders); - $transport->addResponse($expectedResponse); - $response = $gapicClient->searchFolders(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFolders()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Folders/SearchFolders', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchFoldersExceptionTest() - { - $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->searchFolders(); - // 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.resourcemanager.v3.Folders/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.resourcemanager.v3.Folders/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 undeleteFolderTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeleteFolderTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Folder(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/undeleteFolderTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->folderName('[FOLDER]'); - $response = $gapicClient->undeleteFolder($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Folders/UndeleteFolder', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeleteFolderTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function undeleteFolderExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeleteFolderTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->folderName('[FOLDER]'); - $response = $gapicClient->undeleteFolder($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeleteFolderTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFolderTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFolderTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Folder(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateFolderTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $folder = new Folder(); - $folderParent = 'folderParent-1307212104'; - $folder->setParent($folderParent); - $updateMask = new FieldMask(); - $response = $gapicClient->updateFolder($folder, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Folders/UpdateFolder', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getFolder(); - $this->assertProtobufEquals($folder, $actualValue); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFolderTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFolderExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFolderTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $folder = new Folder(); - $folderParent = 'folderParent-1307212104'; - $folder->setParent($folderParent); - $updateMask = new FieldMask(); - $response = $gapicClient->updateFolder($folder, $updateMask); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFolderTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/OrganizationsClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/OrganizationsClientTest.php deleted file mode 100644 index b264ac604fdc..000000000000 --- a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/OrganizationsClientTest.php +++ /dev/null @@ -1,382 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return OrganizationsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new OrganizationsClient($options); - } - - /** @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.resourcemanager.v3.Organizations/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 getOrganizationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $directoryCustomerId = 'directoryCustomerId813284938'; - $etag = 'etag3123477'; - $expectedResponse = new Organization(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDirectoryCustomerId($directoryCustomerId); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->organizationName('[ORGANIZATION]'); - $response = $gapicClient->getOrganization($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.resourcemanager.v3.Organizations/GetOrganization', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getOrganizationExceptionTest() - { - $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->organizationName('[ORGANIZATION]'); - try { - $gapicClient->getOrganization($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 searchOrganizationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $organizationsElement = new Organization(); - $organizations = [ - $organizationsElement, - ]; - $expectedResponse = new SearchOrganizationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setOrganizations($organizations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->searchOrganizations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getOrganizations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Organizations/SearchOrganizations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchOrganizationsExceptionTest() - { - $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->searchOrganizations(); - // 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.resourcemanager.v3.Organizations/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.resourcemanager.v3.Organizations/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()); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/ProjectsClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/ProjectsClientTest.php deleted file mode 100644 index 31e5fc471cfd..000000000000 --- a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/ProjectsClientTest.php +++ /dev/null @@ -1,1096 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ProjectsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ProjectsClient($options); - } - - /** @test */ - public function createProjectTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $projectId = 'projectId-1969970175'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Project(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setProjectId($projectId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createProjectTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $project = new Project(); - $response = $gapicClient->createProject($project); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Projects/CreateProject', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProject(); - $this->assertProtobufEquals($project, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createProjectTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createProjectExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $project = new Project(); - $response = $gapicClient->createProject($project); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createProjectTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteProjectTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $projectId = 'projectId-1969970175'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Project(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setProjectId($projectId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteProjectTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->deleteProject($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Projects/DeleteProject', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteProjectTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteProjectExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->deleteProject($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteProjectTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->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.resourcemanager.v3.Projects/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 getProjectTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $projectId = 'projectId-1969970175'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Project(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setProjectId($projectId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->getProject($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.resourcemanager.v3.Projects/GetProject', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProjectExceptionTest() - { - $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->projectName('[PROJECT]'); - try { - $gapicClient->getProject($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 listProjectsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $projectsElement = new Project(); - $projects = [ - $projectsElement, - ]; - $expectedResponse = new ListProjectsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProjects($projects); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $response = $gapicClient->listProjects($parent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProjects()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Projects/ListProjects', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProjectsExceptionTest() - { - $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 - $parent = 'parent-995424086'; - try { - $gapicClient->listProjects($parent); - // 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 moveProjectTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/moveProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $projectId = 'projectId-1969970175'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Project(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setProjectId($projectId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/moveProjectTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $destinationParent = 'destinationParent-1362053637'; - $response = $gapicClient->moveProject($formattedName, $destinationParent); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Projects/MoveProject', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualApiRequestObject->getDestinationParent(); - $this->assertProtobufEquals($destinationParent, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveProjectTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function moveProjectExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/moveProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $destinationParent = 'destinationParent-1362053637'; - $response = $gapicClient->moveProject($formattedName, $destinationParent); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveProjectTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function searchProjectsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $projectsElement = new Project(); - $projects = [ - $projectsElement, - ]; - $expectedResponse = new SearchProjectsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProjects($projects); - $transport->addResponse($expectedResponse); - $response = $gapicClient->searchProjects(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProjects()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Projects/SearchProjects', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchProjectsExceptionTest() - { - $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->searchProjects(); - // 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.resourcemanager.v3.Projects/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.resourcemanager.v3.Projects/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 undeleteProjectTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeleteProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $projectId = 'projectId-1969970175'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Project(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setProjectId($projectId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/undeleteProjectTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->undeleteProject($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Projects/UndeleteProject', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeleteProjectTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function undeleteProjectExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeleteProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->undeleteProject($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeleteProjectTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateProjectTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $projectId = 'projectId-1969970175'; - $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; - $expectedResponse = new Project(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setProjectId($projectId); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateProjectTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $project = new Project(); - $response = $gapicClient->updateProject($project); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.Projects/UpdateProject', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProject(); - $this->assertProtobufEquals($project, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateProjectTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateProjectExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateProjectTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $project = new Project(); - $response = $gapicClient->updateProject($project); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateProjectTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagBindingsClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagBindingsClientTest.php deleted file mode 100644 index 40ef738f642f..000000000000 --- a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagBindingsClientTest.php +++ /dev/null @@ -1,447 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TagBindingsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TagBindingsClient($options); - } - - /** @test */ - public function createTagBindingTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTagBindingTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $tagValue = 'tagValue2092898444'; - $tagValueNamespacedName = 'tagValueNamespacedName1368345838'; - $expectedResponse = new TagBinding(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setTagValue($tagValue); - $expectedResponse->setTagValueNamespacedName($tagValueNamespacedName); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTagBindingTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $tagBinding = new TagBinding(); - $response = $gapicClient->createTagBinding($tagBinding); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagBindings/CreateTagBinding', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getTagBinding(); - $this->assertProtobufEquals($tagBinding, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagBindingTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createTagBindingExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTagBindingTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $tagBinding = new TagBinding(); - $response = $gapicClient->createTagBinding($tagBinding); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagBindingTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTagBindingTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTagBindingTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTagBindingTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->tagBindingName('[TAG_BINDING]'); - $response = $gapicClient->deleteTagBinding($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagBindings/DeleteTagBinding', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTagBindingTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTagBindingExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTagBindingTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tagBindingName('[TAG_BINDING]'); - $response = $gapicClient->deleteTagBinding($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTagBindingTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function listEffectiveTagsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $effectiveTagsElement = new EffectiveTag(); - $effectiveTags = [ - $effectiveTagsElement, - ]; - $expectedResponse = new ListEffectiveTagsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEffectiveTags($effectiveTags); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $response = $gapicClient->listEffectiveTags($parent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEffectiveTags()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagBindings/ListEffectiveTags', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEffectiveTagsExceptionTest() - { - $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 - $parent = 'parent-995424086'; - try { - $gapicClient->listEffectiveTags($parent); - // 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 listTagBindingsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tagBindingsElement = new TagBinding(); - $tagBindings = [ - $tagBindingsElement, - ]; - $expectedResponse = new ListTagBindingsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTagBindings($tagBindings); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $response = $gapicClient->listTagBindings($parent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTagBindings()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagBindings/ListTagBindings', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTagBindingsExceptionTest() - { - $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 - $parent = 'parent-995424086'; - try { - $gapicClient->listTagBindings($parent); - // 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/ResourceManager/v3/tests/Unit/V3/TagHoldsClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagHoldsClientTest.php deleted file mode 100644 index 08bbdefed9c3..000000000000 --- a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagHoldsClientTest.php +++ /dev/null @@ -1,385 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TagHoldsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TagHoldsClient($options); - } - - /** @test */ - public function createTagHoldTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTagHoldTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $holder = 'holder-1211707988'; - $origin = 'origin-1008619738'; - $helpLink = 'helpLink1297152568'; - $expectedResponse = new TagHold(); - $expectedResponse->setName($name); - $expectedResponse->setHolder($holder); - $expectedResponse->setOrigin($origin); - $expectedResponse->setHelpLink($helpLink); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTagHoldTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->tagValueName('[TAG_VALUE]'); - $tagHold = new TagHold(); - $tagHoldHolder = 'tagHoldHolder-501201275'; - $tagHold->setHolder($tagHoldHolder); - $response = $gapicClient->createTagHold($formattedParent, $tagHold); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagHolds/CreateTagHold', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getTagHold(); - $this->assertProtobufEquals($tagHold, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagHoldTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createTagHoldExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTagHoldTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->tagValueName('[TAG_VALUE]'); - $tagHold = new TagHold(); - $tagHoldHolder = 'tagHoldHolder-501201275'; - $tagHold->setHolder($tagHoldHolder); - $response = $gapicClient->createTagHold($formattedParent, $tagHold); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagHoldTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTagHoldTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTagHoldTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTagHoldTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->tagHoldName('[TAG_VALUE]', '[TAG_HOLD]'); - $response = $gapicClient->deleteTagHold($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagHolds/DeleteTagHold', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTagHoldTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTagHoldExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTagHoldTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tagHoldName('[TAG_VALUE]', '[TAG_HOLD]'); - $response = $gapicClient->deleteTagHold($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTagHoldTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function listTagHoldsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tagHoldsElement = new TagHold(); - $tagHolds = [ - $tagHoldsElement, - ]; - $expectedResponse = new ListTagHoldsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTagHolds($tagHolds); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->tagValueName('[TAG_VALUE]'); - $response = $gapicClient->listTagHolds($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTagHolds()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagHolds/ListTagHolds', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTagHoldsExceptionTest() - { - $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->tagValueName('[TAG_VALUE]'); - try { - $gapicClient->listTagHolds($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()); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagKeysClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagKeysClientTest.php deleted file mode 100644 index 52f59fba05d4..000000000000 --- a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagKeysClientTest.php +++ /dev/null @@ -1,861 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TagKeysClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TagKeysClient($options); - } - - /** @test */ - public function createTagKeyTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTagKeyTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagKey(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTagKeyTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $tagKey = new TagKey(); - $tagKeyShortName = 'tagKeyShortName-1212707262'; - $tagKey->setShortName($tagKeyShortName); - $response = $gapicClient->createTagKey($tagKey); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/CreateTagKey', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getTagKey(); - $this->assertProtobufEquals($tagKey, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagKeyTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createTagKeyExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTagKeyTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $tagKey = new TagKey(); - $tagKeyShortName = 'tagKeyShortName-1212707262'; - $tagKey->setShortName($tagKeyShortName); - $response = $gapicClient->createTagKey($tagKey); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagKeyTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTagKeyTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTagKeyTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new TagKey(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTagKeyTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->tagKeyName('[TAG_KEY]'); - $response = $gapicClient->deleteTagKey($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/DeleteTagKey', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTagKeyTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTagKeyExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTagKeyTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tagKeyName('[TAG_KEY]'); - $response = $gapicClient->deleteTagKey($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTagKeyTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->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.resourcemanager.v3.TagKeys/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 getNamespacedTagKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagKey(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tagKeyName('[TAG_KEY]'); - $response = $gapicClient->getNamespacedTagKey($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.resourcemanager.v3.TagKeys/GetNamespacedTagKey', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getNamespacedTagKeyExceptionTest() - { - $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->tagKeyName('[TAG_KEY]'); - try { - $gapicClient->getNamespacedTagKey($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 getTagKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagKey(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tagKeyName('[TAG_KEY]'); - $response = $gapicClient->getTagKey($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.resourcemanager.v3.TagKeys/GetTagKey', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTagKeyExceptionTest() - { - $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->tagKeyName('[TAG_KEY]'); - try { - $gapicClient->getTagKey($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 listTagKeysTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tagKeysElement = new TagKey(); - $tagKeys = [ - $tagKeysElement, - ]; - $expectedResponse = new ListTagKeysResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTagKeys($tagKeys); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $response = $gapicClient->listTagKeys($parent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTagKeys()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/ListTagKeys', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTagKeysExceptionTest() - { - $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 - $parent = 'parent-995424086'; - try { - $gapicClient->listTagKeys($parent); - // 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.resourcemanager.v3.TagKeys/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.resourcemanager.v3.TagKeys/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 updateTagKeyTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateTagKeyTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagKey(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateTagKeyTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $tagKey = new TagKey(); - $tagKeyShortName = 'tagKeyShortName-1212707262'; - $tagKey->setShortName($tagKeyShortName); - $response = $gapicClient->updateTagKey($tagKey); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagKeys/UpdateTagKey', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getTagKey(); - $this->assertProtobufEquals($tagKey, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTagKeyTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateTagKeyExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateTagKeyTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $tagKey = new TagKey(); - $tagKeyShortName = 'tagKeyShortName-1212707262'; - $tagKey->setShortName($tagKeyShortName); - $response = $gapicClient->updateTagKey($tagKey); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTagKeyTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -} diff --git a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagValuesClientTest.php b/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagValuesClientTest.php deleted file mode 100644 index 2bd2be1f099a..000000000000 --- a/owl-bot-staging/ResourceManager/v3/tests/Unit/V3/TagValuesClientTest.php +++ /dev/null @@ -1,861 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TagValuesClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TagValuesClient($options); - } - - /** @test */ - public function createTagValueTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTagValueTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagValue(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTagValueTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $tagValue = new TagValue(); - $tagValueShortName = 'tagValueShortName397125872'; - $tagValue->setShortName($tagValueShortName); - $response = $gapicClient->createTagValue($tagValue); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/CreateTagValue', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getTagValue(); - $this->assertProtobufEquals($tagValue, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagValueTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createTagValueExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTagValueTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $tagValue = new TagValue(); - $tagValueShortName = 'tagValueShortName397125872'; - $tagValue->setShortName($tagValueShortName); - $response = $gapicClient->createTagValue($tagValue); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTagValueTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTagValueTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTagValueTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new TagValue(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTagValueTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->tagValueName('[TAG_VALUE]'); - $response = $gapicClient->deleteTagValue($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/DeleteTagValue', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTagValueTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteTagValueExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTagValueTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->tagValueName('[TAG_VALUE]'); - $response = $gapicClient->deleteTagValue($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTagValueTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->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.resourcemanager.v3.TagValues/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 getNamespacedTagValueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagValue(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tagValueName('[TAG_VALUE]'); - $response = $gapicClient->getNamespacedTagValue($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.resourcemanager.v3.TagValues/GetNamespacedTagValue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getNamespacedTagValueExceptionTest() - { - $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->tagValueName('[TAG_VALUE]'); - try { - $gapicClient->getNamespacedTagValue($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 getTagValueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagValue(); - $expectedResponse->setName($name2); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->tagValueName('[TAG_VALUE]'); - $response = $gapicClient->getTagValue($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.resourcemanager.v3.TagValues/GetTagValue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTagValueExceptionTest() - { - $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->tagValueName('[TAG_VALUE]'); - try { - $gapicClient->getTagValue($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 listTagValuesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tagValuesElement = new TagValue(); - $tagValues = [ - $tagValuesElement, - ]; - $expectedResponse = new ListTagValuesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTagValues($tagValues); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $response = $gapicClient->listTagValues($parent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTagValues()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/ListTagValues', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTagValuesExceptionTest() - { - $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 - $parent = 'parent-995424086'; - try { - $gapicClient->listTagValues($parent); - // 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.resourcemanager.v3.TagValues/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.resourcemanager.v3.TagValues/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 updateTagValueTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateTagValueTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $parent = 'parent-995424086'; - $shortName = 'shortName1565793390'; - $namespacedName = 'namespacedName1945728673'; - $description = 'description-1724546052'; - $etag = 'etag3123477'; - $expectedResponse = new TagValue(); - $expectedResponse->setName($name); - $expectedResponse->setParent($parent); - $expectedResponse->setShortName($shortName); - $expectedResponse->setNamespacedName($namespacedName); - $expectedResponse->setDescription($description); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateTagValueTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $tagValue = new TagValue(); - $tagValueShortName = 'tagValueShortName397125872'; - $tagValue->setShortName($tagValueShortName); - $response = $gapicClient->updateTagValue($tagValue); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.resourcemanager.v3.TagValues/UpdateTagValue', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getTagValue(); - $this->assertProtobufEquals($tagValue, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTagValueTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateTagValueExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateTagValueTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $tagValue = new TagValue(); - $tagValueShortName = 'tagValueShortName397125872'; - $tagValue->setShortName($tagValueShortName); - $response = $gapicClient->updateTagValue($tagValue); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTagValueTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -}